Well, in this case because you responded to an existing thread rather than starting a new thread you don’t have that option. Neither answer is the solution to the original posting.
When you do start a new thread, you will have a little box with a checkmark below each response. You can press that for the solution to the problem in the original posting.
Given the changes that are in progress with logging (upgrading to Log4J 2) and the userdata folder (moving more stuff out), it might be better to wait. Though I know for a certainty any PR would be gladly accepted.
I’d like to extend the question regarding logging to remote logging. I already found out that the following addition to org.ops4j.pax.logging.cfg makes openhab log to a remote syslog host:
@Dim, thanks for very specific information about maxFileSize and maxBackupIndex. Where are these variables set? Also, maxFileSize is clear. Is maxBackupIndex the maximum number of backup files kept? Once the maxBackupIndex number is reached, the oldest file is deleted? Just collecting information for a contribution to the documentation.
@otherCommenters, all good information, and probably need a single article collecting all the information here and other places about logging overall. That said, I think it is important to add a section about default logging rollover policy in the installation documentation so sysadmins such as myself don’t freak out worrying about systems falling over in the middle of the night because of full disks. I am still on vacation, but I hope to put together a short contribution when I get back.
I am currently setting up my logging preferences and would like to log detailed (DEBUG level) infos to a file while only displaying INFO level stuff in the console. Is that possible somehow?
As @Dim mentioned above, the latest snapshot now uses the new log4j2. The configuration files are different and you should read the official documentation linked above.
Since my problem is related to logging i append it here.
Isn’t it possible to handle the log files with logrotate anymore? I have the following set up:
problem is the copytruncate. When a logrotate is done the new logfile is as big as the old one (and messed up) and new logs are appended. In notepad++ it looks like this:
You do realize that openHAB rotates its own log files right? I’m not sure what would happen if you tried to rotate the log out from under it but I would not expect it to work, as you are seeing. Is there something wrong with letting OH do it for you?
Are you on an SD card? If so I’m willing to bet real money your SD card is failing. I discovered I had a failing SD card when logrotate stopped working and my syslog filled up the whole file system.
No advice needed. If log rotate worked for awhile and doesn’t anymore your SD card is failing. End of story. Backup what you can NOW. Verify the files are not corrupted (most likely they are not), and switch out to a new SD card.
Just upgraded to 2.2.0 #1066 and I cannot get separate logging to work with log4j2, I’ve tried to configure separate log files for netatmo and rules by adding the following lines: