You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Suman (Jira)" <ji...@apache.org> on 2021/07/15 13:31:00 UTC

[jira] [Comment Edited] (LOG4J2-3124) log file name with variables not resolving for the first time

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

Suman edited comment on LOG4J2-3124 at 7/15/21, 1:30 PM:
---------------------------------------------------------

I have generated server.log file with DEBUG enable please find the attachment *server_debug_log_failed_case.log*

For Success case after restarting jboss server with debug enable

*server_debug_log_sucess_case.log*

 

 

 


was (Author: suman_log4j2):
I have generated server.log file with DEBUG enable please find the attachment [^server_sucess_case.log]

> log file name with variables not resolving for the first time
> -------------------------------------------------------------
>
>                 Key: LOG4J2-3124
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3124
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.14.0
>            Reporter: Suman
>            Priority: Major
>         Attachments: log4j2.xml, log_files.PNG, server.log, server_sucess_case.log, web.xml
>
>
> Hi Team,
>     We are using log4j2 as logging utility in our application , Below is the file appender we are using for populating logs in log file
> {code:java}
> <RollingFile name="FILE" fileName="${sys:jboss.server.log.dir}\\server.log.${centricity.log.id}CentricityPractice.log" filePattern="${centricity.log.directory}server.log.${centricity.log.id}CentricityPractice.log"> 
>   <PatternLayout pattern="%d\{ISO8601} %-5p (%t %X\{RequestId} %X\{CallerId}) [%c\{1}] %m%n" /> <Policies> <SizeBasedTriggeringPolicy size="5000KB" />
>   </Policies> 
>   <DefaultRolloverStrategy max="5" />
> </RollingFile>
> {code}
> Here we are using a variable ${centricity.log.id} for creating log file , and we are setting this variable during server startup in listener(com.gehcit.cp.ws.infrastructure.configuration.*ConfigurationLoaderListener*) which is defined in web.xml file. When we do any changes in log4j2.xml and published these variables are not resolving at very first time , but after restarting its working as expected , meaning log files are creating in expected location with correct file names . And this is same for other appenders also , can you help us to fix this problem ? Very first time variables are not resolving the log4j2.xml variables used for log file creation but after restarting jboss its starts working
> PFA for log4j2.xml , web.xml(Where listener is defined to set variables) and ConfigurationLoaderListener.java(Java listener) , screen shot for log file creations
> !log_files.PNG!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)