Ask a Question

How do I plug in log4j framework for custom codegen modules

RohanPalkar
Occasional Contributor

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.slf4j:slf4j-log4j121.7.12'
'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.

1 REPLY 1
ponelat
Staff

Re: How do I plug in log4j framework for custom codegen modules

Hi @RohanPalkar 

 

There are a few different Java-based templates, which one in particular are you basing your template on? 

Here is the list: https://github.com/swagger-api/swagger-codegen-generators/tree/master/src/main/java/io/swagger/codeg...

 

 

cancel
Showing results for 
Search instead for 
Did you mean: