swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.98k stars 6.03k forks source link

[Java]: >3.0.20 spring logging broken #10515

Open mrazjava opened 4 years ago

mrazjava commented 4 years ago
Description

A working spring boot app (say, based on spring-boot-starter-parent 2.3.4.FINAL) and with a working swagger codegen <=3.0.20 will produce application logs as expected. When upgrading to swagger codegen 3.0.21 (or x.x.22), application is no longer able to generate logs.

Swagger-codegen version

Spring logging works w/: codegen <= 3.0.20 Spring logging is broken w/: codegen: 3.0.21, 3.0.22

Steps to reproduce

Take any working spring boot app with swagger codegen (<=3.0.20) and upgrade to a newer version (x.x.21 or x.x.22).

michaelknurr commented 3 years ago

I ran into the exact same problem. After upgrading swagger codegen from 3.0.19 to 3.0.25 the logfile has no longer been updated. Output was only written out to stdout. Going back to 3.0.20 solved the problem. When I went forward to 3.0.20, again no more output in the spring.log logfile.

It seems to be a weird dependency problem. The effective pom only shows a few differences (commons-io, commons-lang3 and guava) when switching from codegen 3.0.20 to 3.0.21. The Problem seems to pop up when a transitive dependency is overridden by another library in the pom.

@mrazjava: Did you finally find out what caused the problem? Did you find a workaround other than staying at 3.0.20?