Salesforce

How to enable log4j logging to troubleshoot issues with remote AdminServers

« Go Back

Information

 
TitleHow to enable log4j logging to troubleshoot issues with remote AdminServers
URL NameHow-to-enable-log4j-logging-in-order-to-troubleshoot-problems-with-adding-remote-AdminServers
Article Number000183122
EnvironmentProduct: OpenEdge
Version: 11.3 and later to 11.7.x inclusive
OS: All supported platforms
Other: Remote AdminServer
Question/Problem Description
How to troubleshoot issues with adding or connecting to remote AdminServers
How to troubleshoot OEM Remote Containers
How to enable debugging for ActiveMQ Remote Monitoring
What is log4j logging used for in the OEM Console:
Logging Subsystem levels
http://localhost:9091/diagnostics/logconsole.jsp
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
To troubleshoot issues with adding or connecting to remote AdminServers

1. Stop the OEM AdminServer

2. Create a file named log4j.properties  anywhere that has read-write access and add the following content to the file:

# Define Console Appender  
log4j.rootLogger=DEBUG,console 

log4j.appender.out=org.apache.log4j.ConsoleAppender
log4j.logger.org.apache.activemq=DEBUG 
log4j.appender.console.Target=System.out
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=[%40.40t]%-30.30c{1}%-5p%m%n

3. Add the following system property into the fathom.init.params file.
( It has to be placed between the if and fi statement towards the end of the file)
 
log4j.configuration=file:/<Path chosen>/log4j.properties

4. Restart the OEM AdminServer with the "-interactive true"  switch:
$  proadsv -start -interactive true
  • With the interactive command line option, proadsv does not spin off a separate jvm, but instead runs the adminserver in the same jvm.  In other words, with -interactive switch the adminserver is running in the same process as proadsv.  
  • All the output from log4j logging will be redirected to the console.
  • The "-interactive true" switch is necessary in order for the AdminServer to print logging information to the console: org.apache.log4j.ConsoleAppender

To print  logging information to a file when starting the AdminServer without "-interactive true" :
 
log4j.rootLogger=DEBUG,file
# Define the File Appender
log4j.appender.file=org.apache.log4j.FileAppender 
log4j.appender.FILE.File=log.out
log4j.appender.FILE.ImmediateFlush=true
log4j.appender.FILE.Threshold=debug
log4j.appender.FILE.Append=false
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n
Workaround
Notes
References to Other Documentation:
Log4j ConsoleAppender Configuration Example  
https://howtodoinjava.com/log4j/log4j-console-appender-example/   

 
Keyword Phrase
Last Modified Date11/6/2020 12:12 PM

Powered by