Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue logging DEBUG level log entries #1886

Open
paulwarwicker opened this issue Dec 2, 2023 · 2 comments
Open

Issue logging DEBUG level log entries #1886

paulwarwicker opened this issue Dec 2, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@paulwarwicker
Copy link

paulwarwicker commented Dec 2, 2023

What happened?

Firstly, thank you for making this available. I have absolutely everything defined in code and would not be able achieve the level of control I have in my automation.

I think there may be an issue with the log() method. I have been trying to log DEBUG level messages to the logging. DEBUG and NOTSET do not appear to be logged even if the log level is explicitly set. All the other levels work OOTB.

There is DEBUG output present in the logfile but these come from appdaemon itself.

Version

4.4.2

Installation type

Docker container

Relevant log output

2023-12-02 21:29:00.751660 CRITICAL automation: testing CRITICAL
2023-12-02 21:29:00.754663 ERROR automation: testing ERROR
2023-12-02 21:29:00.755874 WARNING automation: testing WARNING
2023-12-02 21:29:00.758563 INFO automation: testing INFO

Relevant code in the app or config file that caused the issue

        runtime = datetime.time(0, 0, 0)
        self.set_log_level('DEBUG') # or NOTSET
        self.run_minutely(self.log_test, runtime)

    def log_test(self, kwargs):
        for level in ['CRITICAL','ERROR','WARNING','DEBUG','NOTSET','INFO']: # INFO comes last to ensure we have a final successfully logged entry
            self.log(f'testing {level}', level=level)

Anything else?

Also I think there is a documentation error. The docs say that the default level is WARNING. I believe it should be INFO.

@paulwarwicker paulwarwicker added the bug Something isn't working label Dec 2, 2023
@acockburn
Copy link
Member

Yes, I came across that doc error just yesterday funnily enough. I'll take a look at the levels issue as well, thanks.

@paulwarwicker
Copy link
Author

@acockburn I have just noticed that my logging entries are being added if I list the container log directly. Initially I was using the web interface and they are definitely not shown there. Presumably you choose to ignore these because it can be a bit too much at times, especially if you configure to run hourly or minutely.

Is there a way to configure the log level in the web interface?

-paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants