Skip to content

Tag: logback

Get PID in logback log file

When using logback outside of Spring-Boot, how can I get the ProcessID into the log file name? In the RollingFileAppender I’d like to define: How can I get the ${PID} set or is there a standard way of obtaining this? Answer Learn how to get the own PID from inside the JVM – How can a Java program …

How to use Kafka with SSL via logback appander?

I use this logback appender to send logs to Kafka: https://github.com/danielwegener/logback-kafka-appender When Kafka was PLAINTEXT everything worked correctly. But when Kafka changed to SSL, it is not possible to send messages. I did not find the necessary information in readme.md. Has anyone had this setup …

How to disable PDFBox warn logging

I have a simple java console application. pdfbox is utilized to extract text from PDF files. But there is continuous info printed in console: I really want to remove this information from the console. And I use logback for logging, the logback.xml is just like: I have find some answer say that should change t…

When not to use AsyncAppender in logback by default

Logback supports using an async appender with the class ch.qos.Logback.classic.AsyncAppender and according to the documentation, this will reduce the logging overhead on the application. So, why not just make it the default out of the box. What usecases are better served by using a sync appender. One problem …

How to change log level only for current thread with Logback

In Logback, the log level of a logger can be changed with setLevel() method. But in Logback, because the loggers are singleton, the call of setLevel() method will affect to all other threads that use same logger. Now I have a class used in a web application like this: And in Spring ApplicationConfig.xml: I wa…