<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:D="DAV:" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:st="" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Z="urn:schemas-microsoft-com:"><head><META content="text/html; charset=us-ascii" http-equiv="Content-Type">
<meta content="text/html; charset=us-ascii" http-equiv=Content-Type>
<meta content="Microsoft Word 12 (filtered medium)" name=Generator>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:424688642;
mso-list-type:hybrid;
mso-list-template-ids:-756023084 -2001714138 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:24.75pt;
text-indent:-.25in;}
@list l1
{mso-list-id:1245531122;
mso-list-type:hybrid;
mso-list-template-ids:1893088166 1202760434 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:24.75pt;
text-indent:-.25in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head><BODY>
<DIV>
<div class=Section1>
<p class=MsoNormal>Hi all,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>This issue is quite long outstanding and I did not see any progress
on it so far so I thought it might be worthwhile to rise this issue again(<a href="http://jira.qos.ch/browse/LBCORE-61">http://jira.qos.ch/browse/LBCORE-61</a>).
<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Basically what happens here is, that if you use any other
triggering policy together with the TimeBasedRollingPolicy than your
application will die with an exception. The use case is fairly common for this
kind of feature for example I want to get my log files rotated and I want to
see when that rotation happened. <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>The root cause of this problem lies in the isTriggeringEvent()
method. That method is responsible for setting the elapsedPeriodsFileName variable(besides
telling logback whether we have to trigger or not). When the
TimeBasedRollingPolicy is used with other triggering policy, the
isTriggeringEvent() method is not called hence the elapsedPeriodsFileName is
null hence a an NPE. This can be easily fixed by letting the
TimeBasedRollingPolicy to calculate the elapsedPeriodsFileName when it is not
set yet already:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Public void rollover() throws RolloverFailure{<o:p></o:p></p>
<p class=MsoNormal> If(elapsedPeriodsFileName==null){<o:p></o:p></p>
<p class=MsoNormal> elapsedPeriodsFileName
= activeFileNamePattern.convertDate(new Date(getTime()));<o:p></o:p></p>
<p class=MsoNormal style='text-indent:.5in'>}<o:p></o:p></p>
<p class=MsoNormal style='text-indent:.5in'>Try{<o:p></o:p></p>
<p class=MsoNormal style='text-indent:.5in'> //rest of
the rollover method<o:p></o:p></p>
<p class=MsoNormal style='text-indent:.5in'>}<o:p></o:p></p>
<p class=MsoNormal style='text-indent:.5in'>Finally{<o:p></o:p></p>
<p class=MsoNormal style='text-indent:.5in'>
elapsedPeriodsFileName=null<o:p></o:p></p>
<p class=MsoNormal style='text-indent:.5in'>}<o:p></o:p></p>
<p class=MsoNormal>}<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>With this fix in place a lot more features can be added easily
to the rotating space:<o:p></o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoListParagraph style='margin-left:24.75pt;text-indent:-.25in;
mso-list:l1 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'> </span></span><![endif]>Rotating
on multiple criteria(rotate my files at midnight or when it reaches 1G)( http://jira.qos.ch/browse/LBCORE-60)<o:p></o:p></p>
<p class=MsoListParagraph style='margin-left:24.75pt;text-indent:-.25in;
mso-list:l1 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'> </span></span><![endif]>Rotate
on restart(<a href="http://jira.qos.ch/browse/LBCORE-91">http://jira.qos.ch/browse/LBCORE-91</a>)<o:p></o:p></p>
<p class=MsoListParagraph style='margin-left:24.75pt;text-indent:-.25in;
mso-list:l1 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>3)<span style='font:7.0pt "Times New Roman"'> </span></span><![endif]>The
already mentioned rotate on file size but put timestamp on the files<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>For 1 and 2 we will need a new triggering policy which is an
affirmative triggering policy making decisions based on other triggering
policies set on it. With this new triggering policy 1 can be reached by specifying
a size based triggering policy and a timebased rolling policy as triggering
policies. For 2 a new triggering policy should be created which will say yes on
the first call to isTriggeringEvent and will say no on every subsequent call.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Hope I made my point clear and you guys can make this small
change.<o:p></o:p></p>
<p class=MsoNormal>Thanks for your help in advance,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Regards<o:p></o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Zoltan Szel<br>
</span><b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";
color:black'>Morgan Stanley | IDEAS Practice Areas<br>
</span></b><span style='font-size:7.5pt;font-family:"Arial","sans-serif";
color:black'>Lechner Odon fasor 8 | Floor 07<br>
Budapest, 1095<br>
Phone: +36 1 881-3978<br>
<a href="mailto:Zoli.Szel@MorganStanley.com"><span style='color:blue'>Zoli.Szel@MorganStanley.com</span></a></span><o:p></o:p></p>
</div>
</DIV>
<DIV>
<HR>
</DIV>
<P CLASS="BulletedList" STYLE="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0in; mso-list: none; tab-stops: .5in"><SPAN STYLE="FONT-SIZE: 8pt; COLOR: gray; mso-bidi-font-family: Arial"><FONT COLOR="gray" FACE="Arial" SIZE="1">NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We<SPAN STYLE="FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"> may monitor and store emails to the extent permitted by applicable law.</SPAN></FONT></SPAN></P>
<DIV></DIV></BODY></HTML>