<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18939">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi Everyone,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I'm new to Logback and SLF4J. Things were going
smoothly until I had two requirements - </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Change from a static log file name to a dynamic
one</FONT></DIV>
<DIV><FONT size=2 face=Arial>Pause the console appender</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I googled quite a bit and found code that it
appeared should work, but it unfortunately did not. </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I'll try to keep code/xml inclusion short and to
the point. If someone can guide me on the correct practice to follow, it would
be great. Logback jars are version 0.9.24 and SLF4J is at 1.6.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Relevant portion of logback.xml is:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT face=Arial><SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><configuration
debug="false" scan="false" scanPeriod="60 seconds"></SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"> <!--
snip... --></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT
face=Arial></FONT></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"> <!--
variable used to hold desired log file name </SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
I comment out because I don't seem to be able to override</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
if present </SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
--></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<!--<property name="system.logfile.name" value="deploy"
/>--></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT
face=Arial></FONT></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<!-- snip... --></SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<timestamp key="bySecond" datePattern="yyyyMMdd'_'HH.mm.ss"/></SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<!-- snip... --></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT
face=Arial></FONT></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"> <!--
this is the appender I want to "pause" --> </SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender"></SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<!-- snip... --></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
</appender></SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"></SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><o:p><FONT size=2
face="Courier New"> <!-- this is the
appender that should use a dynamic file name --></FONT></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<appender name="ROLLINGFILE_SYSTEM"
class="ch.qos.logback.core.rolling.RollingFileAppender"></SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<!-- snip... --></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"> <File>${system.logfile.name}-${bySecond}.log</File></SPAN></P><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
<!-- snip... --></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">
</appender></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"> <!--
snip... --></SPAN></P></SPAN><SPAN
style="FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><o:p></o:p></SPAN>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"></configuration></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT
face=Arial></FONT></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT face=Arial>Approaches
tested for dynamic filename: 1) use SLF4J Logger and </FONT></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT face=Arial>Jason
Configurator, 2) use Logback Logger.</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT
face=Arial></FONT></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT
face=Arial>1)</FONT> <FONT face=Arial>In the case below, the logback.xml
file is processed, and a file is created with the name
"system.logfile.name_IS_UNDEFINED..." as expected. I then execute the code below
to change the name (I also delete the file originally created). The result is a
file with the desired name is created - but no logging occurs, either to the
console or the log file! If I *don't* execute the code to change the file name,
logging occurs just fine. I've wasted a ton of time trying to work with this.
But even if this code worked, I'd be out of luck, because use case #2 requires
pasusing an appender, and for that, I need to use the Logback logger directly.
So on two #2 - change the log file name and access appenders.</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT
face=Arial></FONT></SPAN> </P><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><FONT face=Arial>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">import</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
org.slf4j.LoggerFactory;</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">import</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
org.slf4j.Logger;</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal></FONT></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1537"><STRONG>public</STRONG></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt" sab="1538">
</SPAN><B sab="1539"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1540">class</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"
sab="1541"> Foo {</SPAN></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1613"><STRONG></STRONG></SPAN></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1613"><STRONG>private</STRONG></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt" sab="1614">
</SPAN><B sab="1615"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1616">static</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt" sab="1617">
Logger </SPAN><I sab="1618"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #0000c0; FONT-SIZE: 10pt"
sab="1619">logger</SPAN></I><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt" sab="1620"> =
LoggerFactory.<I sab="1621">getLogger</I>(ExecWrapper.</SPAN><B sab="1622"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1623">class</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"
sab="1624">); </SPAN></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"><FONT face=Arial></FONT></SPAN></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"><FONT face=Arial> public static void
main(String[] args) {</FONT></SPAN></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"><FONT face=Arial>
</FONT></SPAN></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><FONT
face=Arial> //
-- attempt to change log file anme</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
LoggerContext lc = (LoggerContext)
LoggerFactory.<I>getILoggerFactory</I>();</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
Jo</SPAN>ranConfigurator configurator = </SPAN><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">new</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
JoranConfigurator();</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
</SPAN></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>String
logFileName = </SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #2a00ff; FONT-SIZE: 10pt">"foo.bar";</SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #2a00ff; FONT-SIZE: 10pt"></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>lc.reset();</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>lc.putProperty(</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #2a00ff; FONT-SIZE: 10pt">"system.logfile.name"</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">,
logFileName);</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>configurator.setContext(lc);</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #3f7f5f; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>configurator.doConfigure(</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #2a00ff; FONT-SIZE: 10pt">"logback.xml"</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">);</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><FONT
face=Arial></FONT></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><FONT
face=Arial>
logger.info("test message.");</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><FONT
face=Arial></FONT></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><FONT
face=Arial>
...etc.</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"
sab="1624"><FONT face=Arial></FONT></SPAN></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"
sab="1624"><FONT face=Arial></FONT></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" sab="1625"><FONT
face=Arial>2) In this code, I'd expect to be able to access the appenders - and
not even have to use Joran. But the appender is null, and even the iterator
for appenders has no elements! I'm sorry, but it's so unbelievably
frustrating - I think life would be easier with plain
old Java logging than with working with this. If anyone has any
thoughts... </FONT></SPAN></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" sab="1625"><FONT
face=Arial></FONT></SPAN></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" sab="1625"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"><STRONG>import</STRONG></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
org.slf4j.LoggerFactory;</SPAN></SPAN></SPAN></P><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" sab="1625">
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">import</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
ch.qos.logback.classic.Logger;</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3
face="Times New Roman"> </FONT></o:p></P><FONT face=Arial>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1537"><STRONG>public</STRONG></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt" sab="1538">
</SPAN><B sab="1539"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1540">class</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"
sab="1541"> Foo {</SPAN></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1613"><STRONG></STRONG></SPAN></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1613"><STRONG>private</STRONG></SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt" sab="1614">
</SPAN><B sab="1615"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1616">static</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt" sab="1617">
Logger </SPAN><I sab="1618"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #0000c0; FONT-SIZE: 10pt"
sab="1619">logger</SPAN></I><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt" sab="1620"> =
(Logger) LoggerFactory.<I sab="1621">getLogger</I>(ExecWrapper.</SPAN><B
sab="1622"><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt"
sab="1623">class</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"
sab="1624">); </SPAN></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"><FONT face=Arial></FONT></SPAN></SPAN> </P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"><FONT face=Arial> public static void
main(String[] args) {</FONT></SPAN></SPAN></P></FONT></SPAN></SPAN>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" sab="1625"><FONT
face=Arial> </P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>LoggerContext
lc = (LoggerContext) LoggerFactory.getILoggerFactory();</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>RollingFileAppender<ILoggingEvent
> fileAppender =</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
</SPAN>(RollingFileAppender<ILoggingEvent
>)logger.getAppender(</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #2a00ff; FONT-SIZE: 10pt">"ROLLINGFILE_SYSTEM"</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">);</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN></SPAN><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">if</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">(fileAppender
!= </SPAN><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">null</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">)
{</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
</SPAN>String logFileName = </SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #2a00ff; FONT-SIZE: 10pt">"foo.bar"</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">;</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes">
</SPAN>fileAppender.stop();</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>fileAppender.setFile(logFileName
+ </SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #2a00ff; FONT-SIZE: 10pt">".log"</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">);</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>fileAppender.setContext(lc);</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>fileAppender.start();</SPAN><SPAN
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><SPAN
style="mso-spacerun: yes"> </SPAN>}</SPAN></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal>Regards,</P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal> </P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal>Gordon</FONT></SPAN></SPAN><FONT
face=Arial></FONT></SPAN></P></FONT></DIV></BODY></HTML>