Latest Questions tagged Logging

Browse all latest questions tagged Logging

Published 27 Aug, 2022
Python - Change levelname format in logRecord

I wonder how I can change the format of levelname in logRecoed using python's logging package. formatter = logging.Formatter('%(levelname)-8s %(message)s') Basically, I want to replace any log name...

Published 15 Sep, 2022
Java - 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...

Published 19 Sep, 2022
Java - Log4j 2. How get log4j's debug messages?

As far as i understand log4j can handle system property -Dlog4j.debug. If you run your app with it you will get log4j's debug output. Example: java -Dlog4j.debug -jar test.jar Is there something sim...

Published 15 Sep, 2022
Java - What is the result of making log4j additivity equals to true or false?

In simple terms what is the result of making additivity="true" or additivity="false" when adding a Log4j configuration for a specific class like this? <Logger name="" lev...

Published 02 Sep, 2022
Java - How to pretty print a complex Java object (e.g. with fields that are collections of objects)?

I'm looking for a library function (ideally from a commonly used framework e.g. Spring, Guava, Apache Commons etc.) that will nicely print the values of any Java object. This is a general question ra...

Published 18 Sep, 2022
Java - Mask certain string attributes in Java during logging?

Is there a way I can mask certain string variables of a class like password, etc which will prevent during logging? Like overriding toString() method in such way it does not print in logs. For instan...

Published 01 Sep, 2022
Java - slf4j logger is not printing the log in console for springboot if wrapped under log.isDebugEnabled()

I am using slf4j logger in my controller class, even though my has the following entries: #logging.level.*= DEBUG

Published 07 Sep, 2022
Java - Can't turn off HttpClient Wire debug log messages

I have been trying to set Wire to not send DEBUG to console, but no matter what I do, it won't listen. I have log4j initialized properly: I do not get any appender messages, log4j is obeying my cla...

Published 30 Jun, 2022
Python - How to see output of print statements when scrapy logger enabled

For debug purposes I need to see both output of log messages and print statements when working with Scrapy. Hovewer, when I start Scrapy logger, I no longer see output of print statements! How should...

Published 11 Aug, 2022
Python - extending logging.Logger module in python 3.5

I have been trying to create a new class of Logger by subclassing logging.Logger . Python version is 3.5 I have several modules in my application and I configure the logging only in the main module w...

Published 20 Aug, 2022
Python - pytest can't see logs from function being tested

I have a flask app like this from flask import Flask import logging app = Flask(__name__) @app.route('/') def catch_all(): logging.warning("I'm a warning") return "This is a REST API" if _...

Published 09 Sep, 2022
Java - Show java.util.logging.Logger logs in Android Studio logcat

I need to watch the log from in Android Studio logcat. For example: Why...

Published 25 Aug, 2022
Java - Selenium chromedriver disable logging or redirect it java

I am trying to use selenium in a mini web crawler to get the page source. My output log is invaded by selenium logs, is there a way to totally disable the logging or just redirect it in someway to /de...

Published 07 Sep, 2022
Java - Should unit tests use logging?

There seems to be two trends on this topic: Some answers (such as this one) suggest unit tests should not log anything. Some questions and answers (such as this one) suggest different logging techni...

Published 06 Sep, 2022
Java - Is it possible for using different pattern layout for different log level and output to SYSTEM_OUT?

For log4j2, is it possible for using different pattern layout for different log level and output to SYSTEM_OUT? Here is my log4j2.xml: <?xml version="1.0" encoding="UTF-8"?> <Config...