I'm using logback 1.1.10 with groovy configuration. I recently discovered shutdownHook preference but I haven't found the way to enable it using groovy configuration. Is this possible? Or a missing feature?
Logback: Enable shutdownHook using Groovy configuration
676 Views Asked by guindous At
1
There are 1 best solutions below
Related Questions in LOGBACK
- Purpose of setting debug="false" in log4j at configuration level
- Masking in logback.xml with all request and responses
- Logback recording SpringBoot class member variable
- Failed to initialize or to run Configurator: ch.qos.logback.classic.util.DefaultJoranConfigurator
- how to strip a variable using logback after a delimiter
- Logging issues on an apache camel spring boot aplication
- Generate new log file using logback when file size goes beyond a limit
- How do I convert the logback.xml configuration file to an application.yml configuration file?
- Logback: availability of MDCs in forks created inside a StructuredTaskScope
- Send logs to DataDog using Logback yierds "Log destination intake.logs.datadoghq.com/<unresolved>:10514: connection failed. "
- Logback midday logs rotation
- Could not find valid configuration instructions -Logback
- Adding a version number marker to logback log with minimal code changes
- Quarkus - logging to multiple logstashes
- Logback: one file for two appenders
Related Questions in LOGBACK-GROOVY
- Is maxHistory property same in both SizeAndTimeBasedRollingPolicy and TimeBasedRollingPolicy
- Write log messages to respective files for parallel tasks
- The below snippet is able to generate the error level logs but is not injecting into the file
- How does a Grails plugin add its own logback.groovy?
- inject grailsApplication in logback
- exception in logback when ansi coding for console display on windows 10 64bit
- Logback: Enable shutdownHook using Groovy configuration
- Logback: Load groovy config
- Spring Boot app having trouble with logback.groovy config file
- A Logback FileAppender that uses a single log file and deletes old log files
- How to activate the "Logback setup" debug mode using groovy configuration file?
- Is there a way to inject a Grails datasource into logback.groovy for use with DBAppender?
- Can't see logback logs in log4j configured embeded Jetty application
- Logback giving error Cannot cast object '3 gb' with class 'java.lang.String' to class 'ch.qos.logback.core.util.FileSize'
- Logback groovy configuration not working in production
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Logback's shutdownHook was added in v1.1.3 and it can be configured using Groovy. The docs are a bit light on this matter and the xml->groovy translator ignores the shutdownHook but I have verified the inclusion of a shutdown hook via Groovy config as follows:
This was confirmed by running a Java process which used logback, explicitly pointing to the above configuration by using
-Dlogback.configurationFileand the resulting output clearly shows the shutdown hook being used: