diff --git a/docs/debugging.md b/docs/debugging.md index c693e7fca2d3f..01bd5cd22e66f 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -166,10 +166,10 @@ openapi-generator generate -g go \ --global-property debugModels,debugOperations ``` -Or you can add these to your `JAVA_OPTS` environment variable (this applies to every invocation of the tool): +Or you can add these to your `JAVA_OPTS` environment variable (this applies to every invocation of the tool). Notice we add a file logger, which makes it easier to consult the verbose model output in the `output.log` file: ```bash -export JAVA_OPTS="${JAVA_OPTS} --global-property debugModels,debugOperations" +export JAVA_OPTS="${JAVA_OPTS} -Dlog.file=output.log --global-property debugModels,debugOperations" ``` > NOTE: Globally available system options like these will apply to all invocations of the generator (CLI and plugins) diff --git a/modules/openapi-generator-cli/src/main/resources/logback.xml b/modules/openapi-generator-cli/src/main/resources/logback.xml index 5bfe446174bd3..3357401aea59f 100644 --- a/modules/openapi-generator-cli/src/main/resources/logback.xml +++ b/modules/openapi-generator-cli/src/main/resources/logback.xml @@ -40,13 +40,29 @@ + + ${log.file} + true + + [%date] [%thread] %-5level %logger{36} - %msg%n + + + + + isDefined("log.file") + + + + isDefined("log.file") + +