on ‎2019 Apr 09 8:37 AM
Hello,
I am trying to change the log level by SET_LOGGING_LEVEL. Details in manifest.yml are below.
---
applications:
- name: springbootlogging
memory: 1024M
timeout: 300
random-route: true
path: application/target/springbootlogging-application.jar
buildpacks:
- sap_java_buildpack
env:
TARGET_RUNTIME: main
SPRING_PROFILES_ACTIVE: 'cloud'
JBP_CONFIG_SAPJVM_MEMORY_SIZES: 'metaspace:128m..'
SET_LOGGING_LEVEL: '{ROOT: WARN, cn.sdk.springboot.controllers: ERROR}'
services:
- my-application-logs
# - my-xsuaa
# - my-destination
# - my-connectivity
There is also a configuration file logback-spring.xml for logback. I can modify the log level by setting logback-spring.xml. But seems it does not work in manifest way.
Could you give me some suggestions?
Request clarification before answering.
Hi Jerry,
You could try to change the JAVA_OPTS env variable as desribed in these two links:
https://github.com/cloudfoundry/java-buildpack/blob/master/docs/framework-java_opts.md
https://stackoverflow.com/questions/34181094/set-logging-level-in-spring-boot-via-environment-variab...
In your case it could be something like:
cf set env JAVA_OPTS '-Dlogging.level.cn.sdk.springboot.controllers=ERROR'
or
env:
java_opts: -Dlogging.level.cn.sdk.springboot.controllers:ERROR
Or maybe the best solution would be:
env:
java_opts: '$java_opts -Dlogging.level.cn.sdk.springboot.controllers:ERROR'
Regards,
Mihailo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.