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

Jesse Docken commented on LOG4J2-398:
-------------------------------------

{noformat}
2013-09-13 15:05:47,084 DEBUG Generated plugins in 0.000043995 seconds
2013-09-13 15:05:47,085 DEBUG Generated plugins in 0.000020677 seconds
2013-09-13 15:05:47,085 DEBUG Generated plugins in 0.000029476 seconds
2013-09-13 15:05:47,086 DEBUG Generated plugins in 0.000018038 seconds
2013-09-13 15:05:47,087 DEBUG Generated plugins in 0.000016719 seconds
2013-09-13 15:05:47,087 DEBUG Generated plugins in 0.000016278 seconds
2013-09-13 15:05:47,087 DEBUG Generated plugins in 0.000016278 seconds
2013-09-13 15:05:47,088 DEBUG Generated plugins in 0.000016279 seconds
2013-09-13 15:05:47,088 DEBUG Generated plugins in 0.000016278 seconds
2013-09-13 15:05:47,089 DEBUG Generated plugins in 0.000015839 seconds
2013-09-13 15:05:47,089 DEBUG Generated plugins in 0.000016719 seconds
2013-09-13 15:05:47,089 DEBUG Generated plugins in 0.000015838 seconds
2013-09-13 15:05:47,090 DEBUG Generated plugins in 0.000015839 seconds
2013-09-13 15:05:47,090 DEBUG Generated plugins in 0.000024638 seconds
2013-09-13 15:05:47,090 DEBUG Generated plugins in 0.000016279 seconds
2013-09-13 15:05:47,106 DEBUG Calling createLayout on class 
org.apache.logging.log4j.core.layout.PatternLayout for element PatternLayout 
with params(pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n", 
Configuration(D:\Git\myApp\target\classes\log4j2.xml), null, charset="null", 
alwaysWriteExceptions="null")
2013-09-13 15:05:47,107 DEBUG Generated plugins in 0.000036516 seconds
2013-09-13 15:05:47,110 DEBUG Calling createAppender on class 
org.apache.logging.log4j.core.appender.ConsoleAppender for element Console with 
params(PatternLayout(%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n), 
null, target="SYSTEM_ERR", name="Console", follow="null", 
ignoreExceptions="null")
2013-09-13 15:05:47,110 DEBUG Jansi is not installed
2013-09-13 15:05:47,110 DEBUG Starting OutputStreamManager SYSTEM_ERR
2013-09-13 15:05:47,112 DEBUG Calling createLayout on class 
org.apache.logging.log4j.core.layout.PatternLayout for element PatternLayout 
with params(pattern="%d %p %c{1.} [%t] ${env:USER} %m%n", 
Configuration(D:\Git\myApp\target\classes\log4j2.xml), null, charset="null", 
alwaysWriteExceptions="null")
2013-09-13 15:05:47,113 DEBUG Calling createPolicy on class 
org.apache.logging.log4j.core.appender.rolling.OnStartupTriggeringPolicy for 
element OnStartupTriggeringPolicy
2013-09-13 15:05:47,114 DEBUG Calling createPolicy on class 
org.apache.logging.log4j.core.appender.rolling.SizeBasedTriggeringPolicy for 
element SizeBasedTriggeringPolicy with params(size="100 MB")
2013-09-13 15:05:47,117 DEBUG Calling createPolicy on class 
org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy for 
element Policies with params(Policies={OnStartupTriggeringPolicy, 
SizeBasedTriggeringPolicy(size=104857600)})
2013-09-13 15:05:47,120 DEBUG Calling createAppender on class 
org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender for 
element RollingRandomAccessFile with 
params(fileName="log/${date:yyyyMMdd-HHmmss} - myApp.log", 
filePattern="log/${date:yyyyMMdd-HHmmss} - myApp-%i.log", append="null", 
name="Rolling", immediateFlush="true", 
Policies(CompositeTriggeringPolicy{OnStartupTriggeringPolicy, 
SizeBasedTriggeringPolicy(size=104857600)}), null, PatternLayout(%d %p %c{1.} 
[%t] ${env:USER} %m%n), null, ignoreExceptions="null", advertise="null", 
advertiseURI="null", Configuration(D:\Git\myApp\target\classes\log4j2.xml))
2013-09-13 15:05:47,126 TRACE RandomAccessFile log/${date:yyyyMMdd-HHmmss} - 
myApp.log seek to 3521
2013-09-13 15:05:47,126 DEBUG Starting RollingRandomAccessFileManager 
log/${date:yyyyMMdd-HHmmss} - myApp.log
2013-09-13 15:05:47,128 DEBUG Generated plugins in 0.000025957 seconds
2013-09-13 15:05:47,130 DEBUG Calling createAppenders on class 
org.apache.logging.log4j.core.config.plugins.AppendersPlugin for element 
appenders with params(Appenders={Console, Rolling})
2013-09-13 15:05:47,131 DEBUG Generated plugins in 0.000021558 seconds
2013-09-13 15:05:47,133 DEBUG Calling createAppenderRef on class 
org.apache.logging.log4j.core.config.AppenderRef for element appender-ref with 
params(ref="Console", level="null", null)
2013-09-13 15:05:47,135 DEBUG Calling createLogger on class 
org.apache.logging.log4j.core.config.LoggerConfig for element logger with 
params(additivity="null", level="fatal", name="com.app.myApp", 
includeLocation="null", AppenderRef={Console}, Properties={}, 
Configuration(D:\Git\myApp\target\classes\log4j2.xml), null)
2013-09-13 15:05:47,136 DEBUG Calling createAppenderRef on class 
org.apache.logging.log4j.core.config.AppenderRef for element appender-ref with 
params(ref="Rolling", level="null", null)
2013-09-13 15:05:47,139 DEBUG Calling createLogger on class 
org.apache.logging.log4j.core.config.LoggerConfig$RootLogger for element root 
with params(additivity="null", level="warn", includeLocation="null", 
AppenderRef={Rolling}, Properties={}, 
Configuration(D:\Git\myApp\target\classes\log4j2.xml), null)
2013-09-13 15:05:47,140 DEBUG Calling createLoggers on class 
org.apache.logging.log4j.core.config.plugins.LoggersPlugin for element loggers 
with params(Loggers={com.app.myApp, root})
2013-09-13 15:05:47,141 DEBUG Shutting down OutputStreamManager SYSTEM_OUT
2013-09-13 15:05:47,142 DEBUG Reconfiguration completed
{noformat}
                
> DateLookup not parsed for FastRollingFile appender
> --------------------------------------------------
>
>                 Key: LOG4J2-398
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-398
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-beta8
>         Environment: Operating System: Windows Server 2008 R2 SP1
> Java Runtime: 1.7.0_03-x64
>            Reporter: Jesse Docken
>
> I'm trying to create a Log4j2 configuration file that will create a log file 
> using DateLookup so that the current date and time are in the filename (so it 
> matches the logging used in our other products).  This is what the appender 
> configuration looks like:
> {code:borderStyle=solid|language=XML}
> <FastRollingFile name="Rolling" fileName="log/$${date:yyyyMMdd-HHmmss} - 
> myApp.log" filePattern="log/$${date:yyyyMMdd-HHmmss} - myApp-%i.log">
>       <immediateFlush>true</immediateFlush>
>       <suppressExceptions>false</suppressExceptions>
>       <PatternLayout>
>               <pattern>%d %p %c{1.} [%t] $${env:USER} %m%n</pattern>
>       </PatternLayout>
>       <Policies>
>               <OnStartupTriggeringPolicy />
>               <SizeBasedTriggeringPolicy size="100 MB"/>
>       </Policies>
> </FastRollingFile>
> {code}
> However when the log file is generated the filename is "${date".  I've tried 
> different variations and haven't been able to get this lookup to work at all.

--
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to