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

Replace :: logger context separator with more commonly used . #13105

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

Replace :: logger context separator with more commonly used . #13105

azasypkin opened this issue Jul 25, 2017 · 4 comments

Comments

@azasypkin
Copy link
Member

To make this work we should change config parsing code a bit since . in property names is used for nested config objects currently, but it should be doable.

@azasypkin
Copy link
Member Author

azasypkin commented Jul 26, 2017

Hey @kjbekkelund, could you please explain a little bit more what you meant here? Do you want to expand only "top-level" properties or what?

Hm, wonder if we could use . as separator if we reworked the logic here https://github.com/elastic/kibana/blob/new-platform/platform/config/__tests__/ensureDeepObject.test.ts#L51-L69 to something like:

test("don't expand nested properties", () => {
  const obj = {
    'foo.bar': {
      'quux.a': 1,
      b: 2
    }
  };

  expect(ensureDeepObject(obj)).toEqual({
    foo: {
      bar: {
        'quux.a': 1,
        b: 2
      }
    }
  });
});

Another idea is that we can go back to the initial approach and use array for loggers, that would probably simpler, but a bit more confusing though as context field is supposed to be unique :/

logging:
  appenders:
    console:
      kind: console
      layout:
        kind: pattern
        highlight: true

  root:
    level: all
    appenders: [console]

  loggers:
    - context: plugins.pid
      level: info
      appenders: [file]
    - context: server
      level: warn

@azasypkin
Copy link
Member Author

azasypkin commented Jul 26, 2017

I see that log4j 2 uses array for loggers if yaml config is used: https://dzone.com/articles/log4j-2-configuration

@azasypkin
Copy link
Member Author

@kjbekkelund would you mind giving me a brief feedback on e6e6dcd?

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