Forum Discussion

RohanPalkar's avatar
Occasional Contributor
3 years ago

How do I plug in log4j framework for custom codegen modules

I am trying to create a custom codegenerator in java using swagger-codegen 3.0.21 version. I see that it uses org.sl4j-api/ext/simple version 1.7.12. However, I need to use log4j-api-2.10.0 to integrate it with my existing source code. 

I tried including 

'org.apache.logging.log4j:log4j-slf4j-impl:2.10.0' // bridge

but I am not getting the log files generated. I am using lo4j2.json (a json based configuration file) and I am certain that it works directly with log4j2 as it is being used in my other projects. 
How can I make this work ? I want to generate logging files from log4j framework.

Appreciate any response. Thanks.