logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Goers (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LOG4J2-326) request to improve the RoutingAppender
Date Tue, 30 Jul 2013 06:27:49 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13723469#comment-13723469
] 

Ralph Goers edited comment on LOG4J2-326 at 7/30/13 6:26 AM:
-------------------------------------------------------------

I'm not entirely sure an enhancement is required.  Have you tried specifying a Route like
below? The leading "$" should get stripped with the configuration is processed leaving a value
of "$\{ctxLfrults}", which won't be replaced because the Route element does not perform variable
substitution on the key. Since the result of an undefined variable string is to leave the
string alone this should result in a match.
{code}
<Route key="$${ctx:fruits}">
  <RollingFile name="Rolling-default" fileName="logs/default.log"
	filePattern="./logs/${date:yyyy-MM}/default-%d{yyyy-MM-dd}-%i.log.gz">
    <PatternLayout>
	<pattern>%d{ISO8601} [%t] %p %c{3} %L - %m%n</pattern>
    </PatternLayout>
    <Policies>
      <TimeBasedTriggeringPolicy interval="6" modulate="true" />
      <SizeBasedTriggeringPolicy size="10 MB" />
    </Policies>
  </RollingFile>
</Route>
{code}
                
      was (Author: ralph.goers@dslextreme.com):
    I'm not entirely sure an enhancement is required.  Have you tried specifying a Route like
below? The leading "$" should get stripped with the configuration is processed leaving a value
of "${ctxLfrults}", which won't be replaced because the Route element does not perform variable
substitution on the key. Since the result of an undefined variable string is to leave the
string alone this should result in a match.
{code}
<Route key="$${ctx:fruits}">
  <RollingFile name="Rolling-default" fileName="logs/default.log"
	filePattern="./logs/${date:yyyy-MM}/default-%d{yyyy-MM-dd}-%i.log.gz">
    <PatternLayout>
	<pattern>%d{ISO8601} [%t] %p %c{3} %L - %m%n</pattern>
    </PatternLayout>
    <Policies>
      <TimeBasedTriggeringPolicy interval="6" modulate="true" />
      <SizeBasedTriggeringPolicy size="10 MB" />
    </Policies>
  </RollingFile>
</Route>
{code}
                  
> request to improve the RoutingAppender
> --------------------------------------
>
>                 Key: LOG4J2-326
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-326
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders
>            Reporter: Sudharma Puranik
>
> Routing Appender has to be improved in a way that it can handle default appenders in
a better way.! Please refer this JIRA for more details
> https://issues.apache.org/jira/browse/LOG4J2-314

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message