<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@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;}
@font-face
{font-family:"Source Code Pro";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",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
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></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 lang="TR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I also used like this way. At the end of the thread, I expect that the file will be done and renamed.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I write custom policy which is named EndEventTriggeringPolicy to open file, and read line by line that file will be done.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">If I debug the code, it is OK (beacuse of invocationGate.isTooSoon) . In fact, i catch the end .
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Non debug mode is ,really , embarrassing. Appender wouldn’t be finished :/ Maybe 1 sec later, or 5 sec later ..<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">The code which I mention ..
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">“if (this.invocationGate.isTooSoon(now)) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> return false;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">“<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">So, thread could be finished but, appender couldnt be finished..
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks..<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><<b>appender name="SIFT" class="CUSTOM….ShiftingAppender"</b>><br>
<<b>discriminator</b>><br>
<<b>key</b>>fileLocation</<b>key</b>><br>
<<b>defaultValue</b>>${user.home}\start.log</<b>defaultValue</b>><br>
</<b>discriminator</b>><br>
<<b>sift</b>><br>
<<b>appender name="FILE-${fileLocation}" class="ch.qos.logback.core.rolling.RollingFileAppender"</b>><br>
<<b>file</b>>${fileLocation}</<b>file</b>><br>
<<b>append</b>>false</<b>append</b>><br>
<<b>encoder</b>><br>
<<b>pattern</b>>%msg%n</<b>pattern</b>><br>
</<b>encoder</b>><br>
<<b>rollingPolicy<br>
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"</b>><br>
<<b>fileNamePattern</b>>${fileLocation}(%i).xml</<b>fileNamePattern</b>><br>
<<b>MinIndex</b>>1</<b>MinIndex</b>><br>
<<b>MaxIndex</b>>2</<b>MaxIndex</b>><br>
</<b>rollingPolicy</b>><br>
<<b>triggeringPolicy<br>
class="com.XXXXXX.EndEventTriggeringPolicy"</b>><br>
</<b>triggeringPolicy</b>><br>
<br>
</<b>appender</b>><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> logback-user <logback-user-bounces@qos.ch>
<b>On Behalf Of </b>haobo liu<br>
<b>Sent:</b> Friday, November 1, 2019 10:09 AM<br>
<b>To:</b> logback users list <logback-user@qos.ch><br>
<b>Subject:</b> Re: [logback-user] About FileAppender in Logback<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I think <span style="font-size:13.0pt;font-family:"Source Code Pro",serif;color:#FF007F;background:#272822">triggeringPolicy</span> need with <span style="font-size:13.0pt;font-family:"Source Code Pro",serif;color:#ECE47E;background:#272822">RollingFileAppender</span>.
combine your needs it may be necessary to implement a special implementation of ch.qos.logback.core.rolling.TriggeringPolicyBase ;)<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If there is a good way, please share,nice day<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><<a href="mailto:Hasan.Birol@ing.com.tr">Hasan.Birol@ing.com.tr</a>>
<span style="font-family:"MS Gothic"">于</span>2019<span style="font-family:"MS Gothic"">年</span>11<span style="font-family:"MS Gothic"">月</span>1<span style="font-family:"MS Gothic"">日周五</span>
<span style="font-family:"MS Gothic"">下午</span>2:04<span style="font-family:"MS Gothic"">写道:</span><o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Dear Logback Team;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Have a problem with logback .<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Have a logback.xml file find it below. Each thread has a single log file. However, cant recognize file is done or thread is done with looking the file. File is not locked or something
(tried to lock the file by extending fileappender but cant succeed) . I don’t would like to write a code to get content of file which I mean, dont wanna write a some symbol to find out file is done. I also used, triggeringPolicy cant succeed..<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><appender name="SIFT" class="XXXXX.SiftingAppender"><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <discriminator><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <key>fileLocation</key><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <defaultValue>${user.home}\start.log</defaultValue><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </discriminator><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <sift><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <appender name="FILE-${fileLocation}" class="ch.qos.logback.core.FileAppender"><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <file>${fileLocation}</file><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <append>false</append><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <encoder><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <pattern>%msg%n</pattern><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </encoder><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </appender><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> </sift><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"></appender><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I just would like to change extension when thread is done .log to .xml, or lock the file while end of the thread, or move the file end of the thread.
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Many many thanks.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Have a nice day,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#767676">Hasan Birol</span></b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#767676">
<br>
Yazılım Danışmanı - Software Consultant <br>
Yazılım Geliştirme Sistemleri ve Platform Uygulamaları Bölümü - Software Development Frameworks and Platform Applications
<br>
<b>T: </b> <br>
<b>E: </b><a href="mailto:Hasan.Birol@ing.com.tr" target="_blank">Hasan.Birol@ing.com.tr</a>
<br>
</span><a href="https://www.ing.com.tr" target="_blank"><span style="text-decoration:none"><img border="0" id="_x0000_i1025" src="http://image.ing.com.tr/EmailBanner/ING_LOGO_89x42px-02.png"></span></a><o:p></o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="100%" align="center">
</div>
<p class="MsoNormal"><i><span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:black"><a href="https://www.ing.com.tr/" target="_blank"><span style="text-decoration:none"><img border="0" id="_x0000_i1027" src="http://image.ingbank.com.tr/EmailBanner/Greatplacetowork_v2.jpg"></span></a></span></i><o:p></o:p></p>
<p><span style="font-size:7.5pt;font-family:"Calibri",sans-serif">Kisiye ozel bu mesaj ve icerigindeki bilgiler gizlidir. ING bu mesajin icerigi ve ekleri ile ilgili olarak hukuksal hicbir sorumluluk kabul etmez. Yetkili alicilardan biri degilseniz, bu mesajin
herhangi bir sekilde ifsa edilmesi, kullanilmasi, kopyalanmasi, yayilmasi veya mesajda yeralan hususlarla ilgili olarak herhangi bir islem yapilmasinin kesinlikle yasak oldugunu bildiririz. Boyle bir durumda lutfen hemen mesajin gondericisini bilgilendiriniz
ve mesaji sisteminizden siliniz.Internet ortaminda gonderilen e-posta mesajlarindaki hata ve/veya eksikliklerden veya viruslerden dolayi mesajin gondericisi herhangi bir sorumluluk kabul etmemektedir. Tesekkur ederiz.</span>
<o:p></o:p></p>
<p><span style="font-size:7.5pt;font-family:"Calibri",sans-serif">The information contained in this communication may contain confidential or legally privileged information. ING doesn't accept any legal responsibility for the contents and attachments of this
message. If you are not the intended recipient you are hereby notified that any disclosure, use, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error,
please notify the sender immediately by responding to this e-mail and then delete it from your system. The sender does not accept any liability for any errors or omissions or any viruses in the context of this message which arise as a result of internet transmission.
Thank you. </span><o:p></o:p></p>
<p> <o:p></o:p></p>
</div>
<p class="MsoNormal">_______________________________________________<br>
logback-user mailing list<br>
<a href="mailto:logback-user@qos.ch" target="_blank">logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><o:p></o:p></p>
</blockquote>
</div>
</div>
<HR><Font face=arial size=1 color=black><I>
<a href="https://www.ing.com.tr/">
<IMG src="http://image.ingbank.com.tr/EmailBanner/Greatplacetowork_v2.jpg">
</a>
</i></font>
<p><font face="Calibri" size="1">Kisiye ozel bu mesaj ve icerigindeki bilgiler gizlidir. ING bu mesajin icerigi ve ekleri ile ilgili olarak
hukuksal hicbir sorumluluk kabul etmez. Yetkili alicilardan biri degilseniz, bu mesajin herhangi bir sekilde
ifsa edilmesi, kullanilmasi, kopyalanmasi, yayilmasi veya mesajda yeralan hususlarla ilgili olarak herhangi bir
islem yapilmasinin kesinlikle yasak oldugunu bildiririz. Boyle bir durumda lutfen hemen mesajin gondericisini
bilgilendiriniz ve mesaji sisteminizden siliniz.Internet ortaminda gonderilen e-posta mesajlarindaki hata
ve/veya
eksikliklerden veya viruslerden dolayi mesajin gondericisi herhangi bir sorumluluk kabul
etmemektedir. Tesekkur ederiz.</font>
</p>
<p><font face="Calibri" size="1">The information contained in this communication may contain
confidential or legally privileged information. ING doesn't accept any legal responsibility for the
contents and attachments of this message. If you are not the intended recipient you are hereby notified that
any disclosure, use, copying, distribution or taking any action in reliance on the contents of this information
is
strictly prohibited. If you have received this communication in error, please notify the sender immediately by
responding to this e-mail and then delete it from your system. The sender does not accept any liability for any
errors or omissions or any viruses in the context of this message which arise as a result of internet
transmission. Thank you.
</p>
</font>
<p>
</p>
</body>
</html>