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

Improve the way we handle default root logger #13098

Closed
azasypkin opened this issue Jul 25, 2017 · 2 comments
Closed

Improve the way we handle default root logger #13098

azasypkin opened this issue Jul 25, 2017 · 2 comments

Comments

@azasypkin
Copy link
Member

After #12852 we'll have a new logging system, but we'll need to improve the way we handle default root logger. Everything works fine until developer wants to add additional logger/appender or just tweak default settings a bit. In this case root logger and appender it depends on should be explicitly defined in the configuration and it's not friendly at all. We should improve it.

Some ideas:

  • log4js has a dedicated config branch for root/default logger, maybe we can have that too.

  • From @kjbekkelund:

Been playing around with this and I think we need to improve the UX. Let's say you're relying on the logging defaults and to debug something you just want to up the log level on your plugin. What feels right to me is being able to just:

logging:
  loggers:
    myPlugin:
      level: debug

Now that fails with "root" logger should be configured!.

Another use case could be wanting to log everything from a plugin to a file while debugging, e.g. something like:

logging:
  appenders:
    myPluginAppender:
      kind: 'file'
      path: './myPlugin.log'
      layout:
        kind: 'pattern'
  loggers:
    myPlugin:
      appenders:
        - myPluginAppender
      level: all

Here we could also just use the defaults for the rest.

Maybe instead of applying the defaults like we do now, we add the default logger and appender automatically, unless you override them. What do you think?

@azasypkin
Copy link
Member Author

I took a stab at it in #13139. It covers all the use cases mentioned in #13098 (comment)

azasypkin added a commit that referenced this issue Jul 31, 2017
Initial commit for the new logging subsystem. Fixes #13098 and #13105.
@azasypkin
Copy link
Member Author

Fixed via 052982d

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

No branches or pull requests

1 participant