I have implemented the custom logging in 10.11 designer using the esb.log4j.xml file. The logs are getting generated in the provider and consumer side… But when the logs are getting generated the log entries are happening like this.
Thanks .im facing the issue where custom loggings were written to same file even though im calling from different packages.
To elaborate the issue ,i have added two packages a/config/ log4j2.xml,b/config/ log4j2.xml in custom wrapper .conf and when i called from any one packages all the logs are going to b.log.
Yeah i did that too .But its writing to same file. initially it created 2 files for each log4j2 config but its writing the logs to only one file.
any idea.
java code:
public static final void loggingcheck(IData pipeline) throws ServiceException {
loggername="namespace.pkg1"(values dynamically passing from run time it should be namespace.pkg1/namespace.pkg2 )
Logger logger = LogManager.getLogger("loggername");
logger.info("testing");
System.out.println("Hello");
}
The issue you’re running into could be related to class loading (see Reverb) As described in the documentation, more specifically in the “Class Searching Order” page, the IS will search for classes (and other resources) in the server classpath first, then locally within the package, and then in all the required packages. Your custom package may be loading the incorrect Log4J configuration file due to this search order. You can easily test this theory by adding the following to your packages manifest.v3 file and reloading the package (or restarting the server):
<value name="classloader">package</value>
I had a very similar issue when moving a customer’s logging package (built on Log4J) from 10.3 to 10.11. In this package, the LoggerContext is initialized with:
… and although this worked fine in 10.3, in 10.11 the wrong Log4J configuration was being picked up. Adding the line above to the package’s manifest file caused the proper configuration to be picked up without code changes. There are code alternatives to this solution as well if changing the manifest file is undesired.
Old PropertyFile is working fine with the filename, but when i change the filename to shared folder location, it is not working? Someone help me on this.