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

java -Dtinylog.writer.level=OFF does not seem to work #162

Closed
ghost opened this issue Aug 19, 2020 · 5 comments
Closed

java -Dtinylog.writer.level=OFF does not seem to work #162

ghost opened this issue Aug 19, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Aug 19, 2020

I'm trying to disable the logger by overriding it with a -D, however, the log files are still being generated as zero length files. Am I doing this correctly? Is there another way?

Using 2.2.0-M2 maven dep
Using jar tinylog.properties in jar file as follows:

writer          = rolling file
writer.locale   = en_US
writer.charset  = UTF-8
writer.level    = info
writer.latest   = logs/my.log
writer.file     = logs/my{count}.log
writer.format   = {date}:{level}:{message}
writer.policies = startup, size: 10kb
writer.backups  = 10
@pmwmedia
Copy link
Member

pmwmedia commented Aug 19, 2020

Do you want to disable only one writer or logging at all? -Dtinylog.writer.level=OFF does not prevent the creation of the writer. It only sets the logging level for the writer. However, -Dtinylog.level=OFF will disable logging completely and prevent the creation of any writer.

@ghost
Copy link
Author

ghost commented Aug 20, 2020

In this one case, I need it to simply disable all writers (all logging essentially). I will try -Dtinylog.level=OFF and let you know how it works. The end goal is not to have a zero length file upon startup. Thanks -Alan

@ghost
Copy link
Author

ghost commented Aug 20, 2020

Unfortunately, I can confirm that it still creates zero length log files based on the aforementioned tinylog.properties in my.jar file. I have a small snippet project that tests this in isolation.

java -Dtinylog.level=OFF -Dfile.encoding=UTF-8 -jar my.jar
Screen Shot 2020-08-19 at 10 23 05 PM

@pmwmedia
Copy link
Member

I can reproduce the issue, too

@pmwmedia pmwmedia added bug and removed question labels Aug 20, 2020
@pmwmedia pmwmedia added this to the 2.2 milestone Aug 20, 2020
@pmwmedia pmwmedia self-assigned this Aug 20, 2020
@github-actions
Copy link

github-actions bot commented Oct 9, 2022

This closed issue has been locked automatically. However, please feel free to file a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant