Skip to content

Commit

Permalink
Made remote logging more verbose for errors, made log statement in w1…
Browse files Browse the repository at this point in the history
…temp warn->debug for most cases
  • Loading branch information
retrodaredevil committed Jan 13, 2021
1 parent 2df2598 commit 3f16889
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions config_templates/log/remote_log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ Do not use this unless you have many devices all contributing to a single SolarT
<PatternLayout pattern="${LOG_PATTERN}"/>
</Console>
<Syslog name="logAll" format="RFC5424" host="192.168.10.251" port="514"
protocol="UDP" appName="mate" includeMDC="true"
protocol="UDP" appName="unknownappname" includeMDC="true"
facility="local0" enterpriseNumber="18060" newLine="true"
messageId="Audit" id="solarthing"/>
messageId="Audit" id="solarthing">
<ExceptionPattern>%ex{full}</ExceptionPattern>
</Syslog>

<RollingFile name="logSummary" fileName="${logPath}/log_summary.log" filePattern="${logPath}/log_summary_%d{yyyy.MM.dd}-%i.log.gz"
filePermissions="${filePermissions}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ public void receive(List<Packet> packets, InstantType instantType) {
LOGGER.error("Could not read slave file for name=" + name, e);
return;
}
if (lines.size() != 2) {
LOGGER.warn("lines.size() is " + lines.size() + "! lines={}", lines);
if (lines.isEmpty()) {
LOGGER.debug("lines is empty! name=" + name); // debug since this is so common
return;
} else if (lines.size() != 2) {
LOGGER.warn("lines.size() is " + lines.size() + "! lines=" + lines + ". name=" + name);
return;
}
String line1 = lines.get(0);
Expand Down

0 comments on commit 3f16889

Please sign in to comment.