I am trying to redirect the output of a specific JavaScript (GraalJS) script into its own log file, but it still doesn’t seem to work. The logs don’t appear in the new file
3. What I see in the logs: In the standard openhab.log, the entries look like this: [INFO ] [org.openhab.automation.openhab-js.WeatherWarnings] - Test message
The Problem: Even though the names seem to match, the file weather-warnings.log is not being created (or remains empty). I have already checked file permissions for the log folder.
Is there a specific prefix I’m missing, or do I need to trigger a refresh differently than just saving the .xml file?
I’ve never used RollingFile as an appender. The docs seem to indicate it works the same as RollingRandomAccessFile appender (which is what the built in log configurations in log4j2.xml use). That’s the only difference I see compared to what I use for custom loggers.
Here’s an example from my config for comparison just in case:
Obviously, the appender goes in the appenders section and the logger goes in the loggers section.
This is a little ambiguous. Is it not created and remains empty if you create it, or sometimes it is created and sometimes it isn’t?
Maybe a refresh? I’ve always had changes made to log4j2.xml picked up immediately upon saving it. But if this file was edited through SAMBA or something like that maybe the file event gets lost. Maybe try touching the file or restarting OH.
If that doesn’t work, post your full log4j2.xml file. Maybe there’s a syntax error in it somewhere.
Haven’t tested further was today again whole day in the hospital and than some wled measurements for the led curtain plugin…will check during the week…