You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Xin Lin (Jira)" <ji...@apache.org> on 2022/10/04 02:33:00 UTC

[jira] [Commented] (LOG4J2-3611) Log4j2 Writing to the rolled file

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

Xin Lin commented on LOG4J2-3611:
---------------------------------

Update: 

I think the issue is caused by the root logger because on the the log file that is put in the root logger has the rolling issue. 

We have 1 root logger n log4j2.xml and another inside standalone.xml logging subsystem. 

To resolve the rolling issue, we can remove the settings in logging subsystem. But I found that if we remove those settings, the root logger in log4j2.xml cannot retrieve the log events in jboss app (I think the jboss app is using jboss Logger). For example, we were able to record log event from "org.jboss.as"/"org.jboss.ejb3" classes, but now those messages cannot be logged in the log file. 

So I wonder {*}if there is any method or adaptor we can use to transfer jboss logger/log events to Log4j2 logger/log events{*}? 

> Log4j2 Writing to the rolled file
> ---------------------------------
>
>                 Key: LOG4J2-3611
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3611
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders, Configuration, Web/Servlet
>    Affects Versions: 2.17.2
>            Reporter: Xin Lin
>            Priority: Major
>
> I am migrating log4j 1 to log4j2 in a jboss application. 
> I added log4j-api & log4j-core & log4j-1.2-api dependencies, I have added log4j2.xml and setup proper system config, and then application good to start. 
> This issue happens when the rolling action triggerred. When the rolled file created, I see that some logs written in the new log file, but some logged in the rolled file. 
> I turned on the TRACE mode, and can see some logs show that Log4j2 RollingFileManager execute the FileRenameAction. So we have two files (app.log & app.log.2022-09-27). 
> But some log events went to app.log, some went to app.log.2022-09-27. 
> According to the log format, I think the new logs in rolled file is written by Log4j2, the log content is like following: 
> 05:01:23,150 INFO [stdout] (Log4j2-AsyncAppenderEventDispatcher-2-ASYNC) 05:01:23,136 ERROR [xxx.xxx] xxxxxxxxxxxxxxxxxxxx
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)