Logging service implementation using log4j2 - Logs not getting printed

I was trying to implement custom logging using Java services and log4j2 jars (as provided by Apache), however I am stuck with the logs not getting printed into my logger as defined.

I read through Blogs such as below - to obtain certain assistance with these and also read the Apache log setup guide:

Apache Log configuration:

Based on these guidelines:

  1. I place both the required JARs (log4j-api-2.11.1, log4j-core-2.11.1) at locaton- “…\packages\LoggingFrameHimanshu\code\jars”
  2. Placed the log4j2.xml at the location - “…\packages\LoggingFrameHimanshu\code\classes\LoggingFrameHimanshu”, with reference to looger file to print in as placed in project folder only i.e. “…\packages\LoggingFrameHimanshu\resources\myLogger.log”
  3. Hence setup a Java flow service in the project to print logs to this - see attached.

However, when I am trying to run the service standalone - passing the parameters as input - the logger will not have logs printed.

Please assist experts. This should be pretty common task on day to day basis - not sure what is being missed here.
LoggingFrameHimanshu.zip (1.59 MB)

Bump … Anyone, assistance much appreciated.

What is the version of webmethods ? Also are you trying to use slf4j or log4j? It gets confusing with both of these - see https://stackoverflow.com/questions/37744857/loggerfactory-vs-logger

are you loading log4j properties xml in memory?
i vaguely remember implementing this… you don’t need to have separate log4j jar file, IS already has log4j in its classpath. in my code i had to create a start up service which would load log4j2.xml file in memory and then in my code i would make use of logger define in property file to log.

That makes sense and sound to be the missing piece her. Let me give it a try a get back on this.

I am using log4j v2.0.