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:
http://techcommunity.softwareag.com/pwiki/-/wiki/Main/Good+To+Know+-+Custom+logging
Apache Log configuration:
http://logging.apache.org/log4j/2.x/manual/configuration.html
Based on these guidelines:
- I place both the required JARs (log4j-API-2.11.1, log4j-core-2.11.1) at locaton- “…\packages\LoggingFrameHimanshu\code\jars”
- 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”
- 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)