-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can easily use custom log4j2.xml, optionall use purejavacomm, adds tt…
…y group
- Loading branch information
1 parent
62dcc6b
commit 185092f
Showing
13 changed files
with
120 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--NOTE: This is not complete yet--> | ||
<Configuration status="WARN"> | ||
<Properties> | ||
<Property name="logPath">logs</Property> | ||
<Property name="LOG_PATTERN">%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n</Property> | ||
<Property name="filePermissions">rw-rw-r--</Property> | ||
</Properties> | ||
<Appenders> | ||
<Console name="Console" target="SYSTEM_OUT"> | ||
<MarkerFilter marker="NO_CONSOLE" onMatch="DENY" onMismatch="NEUTRAL"/> | ||
<PatternLayout pattern="${LOG_PATTERN}"/> | ||
</Console> | ||
<Syslog name="logAll" host="192.168.10.250" port="8514" facility="SYSLOG" protocol="TCP"/> | ||
|
||
<RollingFile name="logSummary" fileName="${logPath}/log_summary.log" filePattern="${logPath}/log_summary_%d{yyyy.MM.dd}-%i.log.gz" | ||
filePermissions="${filePermissions}"> | ||
<PatternLayout pattern="${LOG_PATTERN}"/> | ||
<MarkerFilter marker="SUMMARY" onMatch="ACCEPT" onMismatch="DENY"/> | ||
<Policies> | ||
<OnStartupTriggeringPolicy /> | ||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/> | ||
<SizeBasedTriggeringPolicy size="3GB" /> | ||
</Policies> | ||
<DefaultRolloverStrategy> | ||
<Delete basePath="${logPath}" maxDepth="1"> | ||
<IfFileName glob="log_summary_*.log.gz" /> | ||
<IfLastModified age="400d" /> | ||
</Delete> | ||
</DefaultRolloverStrategy> | ||
</RollingFile> | ||
</Appenders> | ||
<Loggers> | ||
<Root level="DEBUG" > | ||
<AppenderRef ref="Console" level="DEBUG"/> | ||
</Root> | ||
<Logger name="me.retrodaredevil.solarthing"> | ||
<AppenderRef ref="logAll" level="DEBUG"/> | ||
<AppenderRef ref="logInfo" level="INFO"/> | ||
<AppenderRef ref="logSummary" level="DEBUG"/> <!-- We can allow debugs to go through because it will filter for explicit SUMMARY marker --> | ||
</Logger> | ||
<Logger name="org.ektorp" level="INFO"> | ||
<AppenderRef ref="logAll"/> | ||
</Logger> | ||
<Logger name="org.apache.http" level="INFO"> | ||
<AppenderRef ref="logAll"/> | ||
</Logger> | ||
<Logger name="org.influxdb" level="INFO"> | ||
<AppenderRef ref="logAll"/> | ||
</Logger> | ||
</Loggers> | ||
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Log4j | ||
SolarThing uses Log4j2 for logging. (But not the GraphQL program yet, everything else yes) | ||
|
||
You can override the default configuration in a few ways: | ||
|
||
### `log4j2.xml` in working directory | ||
When executing `run.sh`, it is configured to detect a file called `log4j2.xml` in the working | ||
directory. If it finds it, it will use that for the configuration. | ||
### Environment Variable | ||
```shell script | ||
export LOG4j_log4j2_configurationFile=<path to config> | ||
``` | ||
### JVM Argument | ||
``` | ||
java -Dlog4j2.configurationFile=<path to config> ... | ||
``` | ||
|
||
More info: https://stackoverflow.com/questions/778933/log4j-configuration-via-jvm-arguments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Simulate Serial | ||
Here are some commands to help simulate serial | ||
|
||
https://stackoverflow.com/questions/52187/virtual-serial-port-for-linux | ||
|
||
https://www.onetransistor.eu/2015/12/wine-serial-port-linux.html | ||
|
||
```shell script | ||
sudo socat PTY,link=/dev/ttyS10 PTY,link=/dev/ttyS11 | ||
``` | ||
Connect one end to `/dev/ttyS10` and the other to `/dev/ttyS11`. | ||
|
||
Also use this: | ||
```shell script | ||
sudo ./diagslave -m rtu -a 1 -b 9600 -p none /dev/ttyS10 | ||
``` | ||
|
||
If you're doing stuff with wine: | ||
```shell script | ||
cd ~/.wine/dosdevices/ | ||
sudo ln -s /dev/ttyS11 com1 | ||
``` | ||
If you're running Solar Station Monitor using Wine: | ||
```shell script | ||
wine start 'C:\windows\system32\Solar Station Monitor.exe' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters