-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
Change the default logging level to INFO for org.openhab.automation.script #1362
Comments
@digitaldan WDYT about changing the default log level for org.openhab.automation.script to INFO? Within the jruby helper library, we extensively use trace, and they shouldn't show up as default. Even if user scripts were to use TRACE level, I'm sure it's not meant to show up by default. TRACE should only be enabled during debugging. |
Is this currently a problem ? AFAIK this should only be used for user based scripts, and I am not expecting users to have to fiddle with changing the system log levels as there is not a built in way of doing that in the UI. If non user based scripts , like bindings , are logging to this prefix then I would agree this is an issue . |
I understand that this prefix is for user based scripts, and that's exactly what we're going to use it for. Currently jruby scripts logs to When I agree that users shouldn't have to fiddle with system log levels. That's why the default should be INFO, not TRACE. TRACE logs should not show up out of the box by default, whether it is user scripts or binding. So I am proposing here to change it to |
I'm now seeing the following in my openhab.log after converting from dsl to jsscripting. My scripts are not logging anything:
Also garageDoor1TimeStamp is a DateType item. |
So our original intention was that this would be used solely for user provided scripts, not libraries like openhab-js, and we wanted to make sure that If we want this set to INFO , then we could simply remove it altogether, as thats the default for To be fair, most people will use
Those are bugs that slipped into the library, "Extracted event" was fixed a few days ago, and i just removed the "Posted update" , the JS Library should never be doing any logging on it own at any level. |
I would vote to be consistent with the behavior of Rules DSL in this regard which sets the default level to INFO. That's pretty much the established default, at least for any users who have been using OH for any amount of time. I too was surprised when the level jumped down to TRACE because I've a lot of debug level statements in my rules I don't want to see on a regular basis but only when something isn't working. It's probably OK to force users to have to go to the console or XML file for those rare users who want to differentiate between a trace/debug/info/warn/error logging in their rules. Those users are already going to be advanced enough that they can manage adjusting the level. And if it becomes too much of a problem, I can quickly write up a rule template or something to do it for them. ;-) Those who don't care about levels are probably using I think setting the default level to INFO is fine. Those user for whom getting to the console or config xml file is a problem will just use INFO. The rest probably don't have too much heart burn doing so. Just look back over the decade's worth of Rules DSL examples. How many statements do you ever see besides
While I agree with this for now, can we be sure that will always be the case? With my own rule templates and libraries that people use, having the ability to tell them to turn up the logging so I can get more information to debug problems is very useful. From a user's perspective, getting meaningful error messages from the library might also be useful. I'm not sure I would make a blanket ban on logging in the helper libraries. Instead set a high bar to adding it should we need it in the future. |
The jruby helper library uses the same logger, and therefore prefix, as user scripts. I suppose we could sidestep this issue for jruby helper library by simply using |
Good news, I also have "Sending command" entries in the log file as well. |
So i did think about this more, and agree we should set the default logger to INFO as well to be consistant, i'll open a PR. |
Currently
org.openhab.automation.script
log level isTRACE
by default as set inopenhab-distro/launch/app/runtime/log4j2.xml
Line 91 in 995fe61
IMO, This should be changed to INFO so that the default logging setting is usable for scripting engines/libraries without flooding the log with excessive details by default.
The text was updated successfully, but these errors were encountered: