logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: OnStartupTriggeringPolicy/custom header
Date Mon, 20 Jun 2016 04:44:05 GMT
I have already created the fix for this along with allowing the user to specify a minimum file
size for the OnStartupTriggeringPolicy.  I will be creating the Jira issue so I can commit
the fix.

Ralph

> On Jun 19, 2016, at 9:10 PM, Remko Popma <remko.popma@gmail.com> wrote:
> 
> Yes please create a Jira. We need it for our change log anyway. (And I find that email
quickly drops below the horizon...)
> 
> Sent from my iPhone
> 
>> On 2016/06/20, at 12:30, Leon Finker <leonfin@gmail.com> wrote:
>> 
>> Yes i can confirm each reconfigure causes the rollover, which is not good
>> for us. Should I create jira? Thank you
>>> On Jun 15, 2016 12:25 PM, "Ralph Goers" <ralph.goers@dslextreme.com> wrote:
>>> 
>>> I can add an option to the OnStartupTriggeringPolicy to only roll if the
>>> file meets or exceeds a minimum value. The default would be 1 byte.
>>> 
>>> Also, I believe I introduced another bug.  The file is now going to roll
>>> every time a reconfiguration takes place, which is obviously incorrect. I
>>> need to fix that asap.
>>> 
>>> The PatternLayout does not support interpolation of the header and footer
>>> but the Configuration does. All attributes are interpolated as the
>>> configuration is read.  You could create your own custom Lookup to get the
>>> processId, but that may be something we should add to the standard set of
>>> properties.
>>> 
>>> Actually, the triggering policy could write to the file since it has
>>> access to the Manager.
>>> 
>>> Ralph
>>> 
>>> 
>>> 
>>>> On Jun 15, 2016, at 8:17 AM, Leon Finker <leonfin@gmail.com> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> What would be the best way to implement the following:
>>>> 1. Always roll log file once on JVM startup (and only on JVM startup).
>>> - This could be done with implementing another OnStartupTriggeringPolicy
>>> (the one from 2.6.1+ doesn't roll empty files anymore).
>>>> 2. Log an entry in the new log file (after the roll) with something like:
>>>> Constants.LINE_SEPARATOR + "---------- " + DateTime.now() + " STARTING "
>>> + service_instance_Name + " " + getProcessId() + " ----------"
>>>> - Does PatternLayout's header support system property lookup variables
>>> (i.e.: service instance name and date time now)?
>>>> - Not sure how to allow for custom method call to get the getProcessId()
>>> into the header
>>>> - It could've been easy if I could do it from OnStartupTriggeringPolicy,
>>> but there is no way to write to the new rolled log file from there.
>>>> 
>>>> Is there a way?
>>>> 
>>>> Thank you
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>> 
>>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message