Does anybody know what the classpath of log4j2 is? Where can I find the file


This really smells of an XY Problem, or this is in the wrong category. You shouldn’t have to know or care about classpath unless you are developing for OH (in which case this belongs in the development category).

No matter what, you need to provide a whole lot more information about what you are trying to accomplish and why you need the classpath for log4j2 in the first place.

It is not a xy problem. I just want to use this file as a template to create my own eventTemplate file for a json-based log file.

Well, it is an XY Problem because knowing the classpath doesn’t help you much here. The classpath is only going to tell really how to find that file. It’s going to be buried deep in a jar file inside a kar file somewhere in the core Karaf binaries which you can find under $OH_RUNTIME/system. You can probably narrow it down a bit based on filename but there is no guarantee that this file exists anywhere in the OH set of jar files in the first place. Ultimately you’ll need to open the jar/kar files that look most promising and search through the files there to find the file.

But if all you want is the contents of the file a quick Google search reveals

which has that EcsLayout.json file on the page.

1 Like

Thanks Rich. This is where I was coming from (Apache website). Didn‘t get it that this content is the full trmplate file.

Are you looking for this ( this is based on OH3 ) ?

7z l /usr/share/openhab/runtime/system/org/ops4j/pax/logging/pax-logging-log4j2/2.0.16/pax-logging-log4j2-2.0.16.jar| grep Ecs
2021-12-27 16:31:36 .....          890          302  EcsLayout.json
1 Like