<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>Hey,</div>
<div><br>
</div>
<div>I have been using logback for some time with monolithic java batch apps (ETL). I am a very part time jave programmer at my job (10% at most)</div>
<div><br>
</div>
<div>I now am working on an application that has two main programs but uses 90% of the same code base. So one project, two jar file artifacts.</div>
<div>(two programs labeled people and position)</div>
<div><br>
</div>
<div>The logging is pretty simple</div>
<ul>
<li>one log file for each run</li><li>log files are denoted with people_timestamp.log or position_timestamp.log</li><li>error logging sends email as well as writes to the log file</li></ul>
<div><br>
</div>
<div>this is my problem: When I run the first main program that is working it creates both log files and one is empty. I only want the one log file that is needed created.</div>
<div><br>
</div>
<div>I'm sure I'm making this way more complicated than it needs to be.</div>
<div><br>
</div>
<div>In the code base for people</div>
<div><br>
</div>
<div>PeopleXmlMain.log = LoggerFactory.getLogger("people");</div>
<div>PeopleXmlMain.logErr = LoggerFactory.getLogger("peopleerror");</div>
<div><br>
</div>
<div>similar for position main</div>
<div>
<div>PositionXmlMain.log = LoggerFactory.getLogger("position");</div>
<div>PositionXmlMain.logErr = LoggerFactory.getLogger("positionerror");</div>
</div>
<div><br>
</div>
<div>the config file</div>
<div>================================</div>
<div>
<div><configuration debug="true"></div>
<div><br>
</div>
<div> <timestamp key="bySecond" datePattern="yyyyMMdd'T'HHmmss"/></div>
<div> <!-- TODO this needs lot of changes, additions</div>
<div> create a logger called applogger</div>
<div><br>
</div>
<div> http://stackoverflow.com/questions/15140935/file-and-stdout-appenders-in-logback-xml</div>
<div> --></div>
<div><br>
</div>
<div> <appender name="ERROREMAIL" class="ch.qos.logback.classic.net.SMTPAppender"></div>
<div> <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker"></div>
<div> <!-- send just one log entry per email --></div>
<div> <bufferSize>1</bufferSize></div>
<div> </cyclicBufferTracker></div>
<div> <smtpHost>autosmtp.richmond.edu</smtpHost></div>
<div> <to>someone@somedomain.com</to></div>
<div> <!-- <to>ANOTHER_EMAIL_DESTINATION</to> additional destinations are possible --></div>
<div> <subject>Error in directory loader: %logger{20}</subject></div>
<div> <layout class="ch.qos.logback.classic.PatternLayout"></div>
<div> <pattern>%date %-30(%d{HH:mm:ss.SSS} [%M]) %-5level %-33(%C{32}) - %msg%n%n%ex%n%n</pattern></div>
<div> </layout></div>
<div> </appender></div>
<div><br>
</div>
<div> <appender name="ERROREMAILPEOPLE" class="ch.qos.logback.classic.net.SMTPAppender"></div>
<div> <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker"></div>
<div> <!-- send just one log entry per email --></div>
<div> <bufferSize>1</bufferSize></div>
<div> </cyclicBufferTracker></div>
<div>
<div> <smtpHost>autosmtp.richmond.edu</smtpHost></div>
<div> <to>someone@somedomain.com</to></div>
</div>
<div> <!-- <to>ANOTHER_EMAIL_DESTINATION</to> additional destinations are possible --></div>
<div> <subject>Error in People2Xml: %logger{20}</subject></div>
<div> <layout class="ch.qos.logback.classic.PatternLayout"></div>
<div> <pattern>%date %-30(%d{HH:mm:ss.SSS} [%M]) %-5level %-33(%C{32}) - %msg%n%n%ex%n%n</pattern></div>
<div> </layout></div>
<div> </appender></div>
<div><br>
</div>
<div><br>
</div>
<div> <appender name="ERROREMAILPOSITION" class="ch.qos.logback.classic.net.SMTPAppender"></div>
<div> <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker"></div>
<div> <bufferSize>1</bufferSize></div>
<div> </cyclicBufferTracker></div>
<div>
<div> <smtpHost>autosmtp.richmond.edu</smtpHost></div>
<div> <to>someone@somedomain.com</to></div>
</div>
<div> <subject>Error in Position2Xml: %logger{20}</subject></div>
<div> <layout class="ch.qos.logback.classic.PatternLayout"></div>
<div> <pattern>%date %-30(%d{HH:mm:ss.SSS} [%M]) %-5level %-33(%C{32}) - %msg%n%n%ex%n%n</pattern></div>
<div> </layout></div>
<div> </appender></div>
<div><br>
</div>
<div> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"></div>
<div> <!-- encoders are assigned the type</div>
<div> ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --></div>
<div> <encoder></div>
<div> <pattern>%-40(%d{HH:mm:ss.SSS} [%M]) %-5level %-36(%C{32}) - %msg%n</pattern></div>
<div> </encoder></div>
<div> </appender></div>
<div><br>
</div>
<div> <appender name="FILEPEOPLE" class="ch.qos.logback.core.FileAppender"></div>
<div> <file>/somepath/logs/people_${bySecond}.log</file></div>
<div> <append>true</append></div>
<div> <!-- encoders are assigned the type</div>
<div> ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --></div>
<div> <encoder></div>
<div> <pattern>%-40(%d{HH:mm:ss.SSS} [%M]) %-5level %-36(%C{32}) - %msg%n</pattern></div>
<div> </encoder></div>
<div> </appender></div>
<div><br>
</div>
<div> <appender name="FILEPOSITION" class="ch.qos.logback.core.FileAppender"></div>
<div> <file>/somepath/logs/position_${bySecond}.log</file></div>
<div> <append>true</append></div>
<div> <!-- encoders are assigned the type</div>
<div> ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --></div>
<div> <encoder></div>
<div> <pattern>%-40(%d{HH:mm:ss.SSS} [%M]) %-5level %-36(%C{32}) - %msg%n</pattern></div>
<div> </encoder></div>
<div> </appender></div>
<div><!-- suppress apache ldap info log messages --></div>
<div> <logger name="org.apache" level="warn" /></div>
<div> <logger name="Error" level="error"></div>
<div> <appender-ref ref="ERROREMAIL" /></div>
<div> </logger></div>
<div><br>
</div>
<div> <logger name="people" level="info"></div>
<div> <appender-ref ref="FILEPEOPLE" /></div>
<div> <appender-ref ref="ERROREMAIL" /></div>
<div> </logger></div>
<div> <logger name="position" level="info"></div>
<div> <appender-ref ref="FILEPOSITION" /></div>
<div> <appender-ref ref="ERROREMAIL" /></div>
<div> </logger></div>
<div><br>
</div>
<div> <logger name="peopleerror" level="info"></div>
<div> <appender-ref ref="ERROREMAILPEOPLE" /></div>
<div> </logger></div>
<div> <logger name="positionerror" level="info"></div>
<div> <appender-ref ref="ERROREMAILPOSITION" /></div>
<div> </logger></div>
<div><br>
</div>
<div> <root level="info"></div>
<div> <appender-ref ref="STDOUT" /></div>
<div> </root></div>
<div></configuration></div>
</div>
<div><br>
</div>
<div>
<div>
<div>
<div>-- </div>
<div>Eric Palmer</div>
</div>
<div>Web Services</div>
<div>U of Richmond</div>
<div><br>
</div>
<div>To report technical issues, obtain technical support or make requests for enhancements please visit <a href="http://web.richmond.edu/contact/technical-support.html">http://web.richmond.edu/contact/technical-support.html</a></div>
</div>
</div>
</div>
</div>
</body>
</html>