Problem converting from Log4j to Log4j2 (log files not being created)

"Nelligan, Steven M" <[email protected]> Tue, 7 Jan 2025 14:41:40 +0000
Newsgroups gmane.comp.jakarta.log4j.user
Message-ID <CH0PR11MB57400ABF27743E1FE63E2BD1AC112@CH0PR11MB5740.namprd11.prod.outlook.com>
--_000_CH0PR11MB57400ABF27743E1FE63E2BD1AC112CH0PR11MB5740namp_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I am trying to convert a tomcat app from log4j to log4j2. The app is still =
written in Java 7 so I am using log4j2 version 2.12.1.
I am getting DEBUG information in stdout file which would indicated that th=
e xml file is being read. No errors are showing in the log file.
following is the log4j2.xml file:
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<Configuration status=3D"DEBUG">
  <Appenders>
    <File name=3D"File" fileName=3D"g:\tomcat\logs\account-request.log">
      <PatternLayout pattern=3D"%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%=
n"/>
    </File>
  </Appenders>
  <Loggers>
    <Root level=3D"DEBUG">
      <AppenderRef ref=3D"File"/>
    </Root>
  </Loggers>
</Configuration>
The classes contain:
    import org.apache.logging.log4j.LogManager;
    import org.apache.logging.log4j.Logger;
    private static final Logger logger =3D LogManager.getLogger(<className>=
.class);
Any ideas to why the log file is not being created
Don't think it will make a difference, but this is running under jetspeed p=
ortal software within tomcat.
Thanks in advance.
log entries relating to Log4j
2025-01-06 12:08:38,737 localhost-startStop-5 DEBUG Apache Log4j Core 2.12.=
1 initializing configuration XmlConfiguration[location=3DG:\Tomcat7\temp\51=
-accountrequest\WEB-INF\classes\log4j2.xml]
...
2025-01-06 12:08:38,737 localhost-startStop-5 DEBUG Building Plugin[name=3D=
layout, class=3Dorg.apache.logging.log4j.core.layout.PatternLayout].
2025-01-06 12:08:38,753 localhost-startStop-5 DEBUG PluginManager 'TypeConv=
erter' found 26 plugins
2025-01-06 12:08:38,769 localhost-startStop-5 DEBUG PatternLayout$Builder(p=
attern=3D"%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n", PatternSelector=3D=
null, Configuration(G:\Tomcat7\temp\51-accountrequest\WEB-INF\classes\log4j=
2.xml), Replace=3Dnull, charset=3D"null", alwaysWriteExceptions=3D"null", d=
isableAnsi=3D"null", noConsoleNoAnsi=3D"null", header=3D"null", footer=3D"n=
ull")
2025-01-06 12:08:38,769 localhost-startStop-5 DEBUG PluginManager 'Converte=
r' found 44 plugins
2025-01-06 12:08:38,784 localhost-startStop-5 DEBUG Building Plugin[name=3D=
appender, class=3Dorg.apache.logging.log4j.core.appender.FileAppender].
2025-01-06 12:08:38,784 localhost-startStop-5 DEBUG FileAppender$Builder(fi=
leName=3D"g:\tomcat\logs\account-request.log", append=3D"null", locking=3D"=
null", advertise=3D"null", advertiseUri=3D"null", createOnDemand=3D"null", =
filePermissions=3D"null", fileOwner=3D"null", fileGroup=3D"null", bufferedI=
o=3D"null", bufferSize=3D"null", immediateFlush=3D"null", ignoreExceptions=
=3D"null", PatternLayout(%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n), nam=
e=3D"File", Configuration(G:\Tomcat7\temp\51-accountrequest\WEB-INF\classes=
\log4j2.xml), Filter=3Dnull, =3D{})
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Starting FileManager g:=
\tomcat\logs\account-request.log
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Building Plugin[name=3D=
appenders, class=3Dorg.apache.logging.log4j.core.config.AppendersPlugin].
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG createAppenders(=3D{Fil=
e})
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Building Plugin[name=3D=
AppenderRef, class=3Dorg.apache.logging.log4j.core.config.AppenderRef].
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG createAppenderRef(ref=
=3D"File", level=3D"null", Filter=3Dnull)
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Building Plugin[name=3D=
root, class=3Dorg.apache.logging.log4j.core.config.LoggerConfig$RootLogger]=
.
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG createLogger(additivity=
=3D"null", level=3D"DEBUG", includeLocation=3D"null", =3D{File}, =3D{}, Con=
figuration(G:\Tomcat7\temp\51-accountrequest\WEB-INF\classes\log4j2.xml), F=
ilter=3Dnull)
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Building Plugin[name=3D=
loggers, class=3Dorg.apache.logging.log4j.core.config.LoggersPlugin].
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG createLoggers(=3D{root}=
)
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Configuration XmlConfig=
uration[location=3DG:\Tomcat7\temp\51-accountrequest\WEB-INF\classes\log4j2=
.xml] initialized
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Starting configuration =
XmlConfiguration[location=3DG:\Tomcat7\temp\51-accountrequest\WEB-INF\class=
es\log4j2.xml]
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Started configuration X=
mlConfiguration[location=3DG:\Tomcat7\temp\51-accountrequest\WEB-INF\classe=
s\log4j2.xml] OK.
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Shutting down OutputStr=
eamManager SYSTEM_OUT.false.false-1
2025-01-06 12:08:38,800 localhost-startStop-5 DEBUG Shut down OutputStreamM=
anager SYSTEM_OUT.false.false-1, all resources released: true
2025-01-06 12:08:38,815 localhost-startStop-5 DEBUG Appender DefaultConsole=
-1 stopped with status true
2025-01-06 12:08:38,815 localhost-startStop-5 DEBUG Stopped org.apache.logg=
ing.log4j.core.config.DefaultConfiguration@74b24ee OK
...
2025-01-06 12:08:38,831 localhost-startStop-5 DEBUG LoggerContext[name=3D6a=
dd4d36, org.apache.logging.log4j.core.LoggerContext@1c8ebe8f] started OK.
JetspeedContainerServlet: starting initialization of Portlet Application at=
: accountrequest
JetspeedContainerServlet: initialization done for Portlet Application at: a=
ccountrequest


Steven M Nelligan
SENIOR SOFTWARE DEVELOPER

--_000_CH0PR11MB57400ABF27743E1FE63E2BD1AC112CH0PR11MB5740namp_--