Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

refactor(logging)!: rename log prefix from jsr223.jruby to org.openhab.automation.jruby #489

Merged
merged 1 commit into from
Jan 15, 2022

Conversation

jimtng
Copy link
Collaborator

@jimtng jimtng commented Jan 13, 2022

Resolve #464

jsr223.jruby is a custom log prefix that would require users to specifically enable in the karaf console. This is an extra step that could be avoided to improve user's first time experience.

org.openhab prefix is set to INFO by default

In Openhab 3.2 distro, a new prefix was created org.openhab.automation.script, however it is set to TRACE by default, making it impractical for us to use.

This PR chose org.openhab.automation.jruby as a unique log prefix to use, relying on the org.openhab default as INFO.

@jimtng
Copy link
Collaborator Author

jimtng commented Jan 14, 2022

@boc-tothefuture I can't figure out why it's failing on gem_install. Would you mind taking a look please?

@boc-tothefuture
Copy link
Owner

I can look this weekend - it does pass locally for me.

@jimtng
Copy link
Collaborator Author

jimtng commented Jan 14, 2022

I figured out why gem_install was failing. This test clears GEM_HOME and installs the openhab-jruby library from rubygems.org, i.e. not the version in the PR that contained the changes to logger prefix. The rubygems.org version is still logging to jsr223.jruby and in this PR, that prefix is not enabled in karaf, so its logs never showed up.

I stumbled on the same issue in another PR that's caused by this.

It's fixed by not loading a rule after cleaning the GEM_HOME.

@boc-tothefuture
Copy link
Owner

Awesome - great find. This needs to be marked as breaking correct? It will impact people's running setups.

@jimtng
Copy link
Collaborator Author

jimtng commented Jan 14, 2022

This needs to be marked as breaking correct? It will impact people's running setups.

I suppose if they have set jsr223.jruby to other than INFO, it would change things for them, but I don't think it would be breaking as such - it doesn't change the behaviour/outcome of their rules unless their rules read from / rely on the contents of the log file?

Do you still think it should be marked as breaking?

@boc-tothefuture
Copy link
Owner

Yes, I think it is still breaking. If they set something to debug level in the old path it won't be in debug after this upgrade.

@jimtng jimtng changed the title refactor(logging): rename log prefix from jsr223.jruby to org.openhab.automation.jruby refactor(logging)!: rename log prefix from jsr223.jruby to org.openhab.automation.jruby Jan 15, 2022
@jimtng
Copy link
Collaborator Author

jimtng commented Jan 15, 2022

I've added the breaking flag

@jimtng
Copy link
Collaborator Author

jimtng commented Jan 15, 2022

After all these breaking changes, we'll have to update the installation documentation, possibly also the one for the bundle.

@boc-tothefuture boc-tothefuture merged commit 338c890 into boc-tothefuture:main Jan 15, 2022
@jimtng jimtng deleted the logger-prefix branch January 15, 2022 02:53
@github-actions
Copy link

🎉 This PR is included in version 4.28.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change the logger prefix to org.openhab.automation.script
2 participants