{"action":"created","issue":{"url":"https://api.github.com/repos/structured-log/structured-log/issues/33","repository_url":"https://api.github.com/repos/structured-log/structured-log","labels_url":"https://api.github.com/repos/structured-log/structured-log/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/structured-log/structured-log/issues/33/comments","events_url":"https://api.github.com/repos/structured-log/structured-log/issues/33/events","html_url":"https://github.com/structured-log/structured-log/issues/33","id":177729565,"number":33,"title":"Is it possible to update the log level?","user":{"login":"nitro52","id":643962,"avatar_url":"https://avatars.githubusercontent.com/u/643962?v=3","gravatar_id":"","url":"https://api.github.com/users/nitro52","html_url":"https://github.com/nitro52","followers_url":"https://api.github.com/users/nitro52/followers","following_url":"https://api.github.com/users/nitro52/following{/other_user}","gists_url":"https://api.github.com/users/nitro52/gists{/gist_id}","starred_url":"https://api.github.com/users/nitro52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitro52/subscriptions","organizations_url":"https://api.github.com/users/nitro52/orgs","repos_url":"https://api.github.com/users/nitro52/repos","events_url":"https://api.github.com/users/nitro52/events{/privacy}","received_events_url":"https://api.github.com/users/nitro52/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-19T08:34:53Z","updated_at":"2016-09-28T08:49:04Z","closed_at":null,"body":"Hey, I'm looking at updating the structured-log-seq-sink to support dynamic log levels. When the sink logs a request the response will contain the current log level. You an also check at regular intervals allowing you to disable logging or increase the log level when debugging a problem in production and then scale it back to something like Error when done.\r\n\r\nI'm thinking that the sink would call something that would update the min log level for the current logger.  I've been looking over the code and i don't think this is possible at the moment with the current architecture but i'm still trying to wrap my head around how it all fits together.  \r\n\r\nSo a few questions\r\n1. Is it already possible for a sink to update the minLogLevel? \r\n2. Any suggestions on how you might support this? Perhaps something with the LevelMap?"},"comment":{"url":"https://api.github.com/repos/structured-log/structured-log/issues/comments/250108828","html_url":"https://github.com/structured-log/structured-log/issues/33#issuecomment-250108828","issue_url":"https://api.github.com/repos/structured-log/structured-log/issues/33","id":250108828,"user":{"login":"nitro52","id":643962,"avatar_url":"https://avatars.githubusercontent.com/u/643962?v=3","gravatar_id":"","url":"https://api.github.com/users/nitro52","html_url":"https://github.com/nitro52","followers_url":"https://api.github.com/users/nitro52/followers","following_url":"https://api.github.com/users/nitro52/following{/other_user}","gists_url":"https://api.github.com/users/nitro52/gists{/gist_id}","starred_url":"https://api.github.com/users/nitro52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitro52/subscriptions","organizations_url":"https://api.github.com/users/nitro52/orgs","repos_url":"https://api.github.com/users/nitro52/repos","events_url":"https://api.github.com/users/nitro52/events{/privacy}","received_events_url":"https://api.github.com/users/nitro52/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T08:49:04Z","updated_at":"2016-09-28T08:49:04Z","body":"@Wedvich \r\nI was looking at your ES6 implementation and noticed you beat me to adding the dynamicLevelMap. In this scenario the seq-sink would need a reference to the same levelMap as the one passed to minLevel. It seems a bit odd to have to write something like this though\r\n\r\n```\r\n   const levelMap = new LevelMap();\r\n   const seqSink = new SeqSink(levelMap);\r\n\r\n    const logger = new LoggerConfiguration()\r\n      .minLevel(levelMap)\r\n      .writeTo(logSink)\r\n      .create();\r\n```\r\n\r\nbecause you need to pass the same instance into structured log and seqSink. I was thinking about updating the writeTo function to initialise the minLogLevel based on the sinks logLevel. Something like this. \r\n\r\n```\r\n  writeTo(sinkOrLogger) {\r\n    if (typeof sinkOrLogger === 'function') {\r\n      sinkOrLogger = new WrappedSink(sinkOrLogger);\r\n    }\r\n    if(sinkOrLogger.levelMap instanceof LevelMap) {\r\n      minLevel(sinkOrLogger.levelMap)\r\n    }\r\n    _pipelineStages.get(this).push(new SinkStage(sinkOrLogger));\r\n    return this;\r\n  }\r\n```\r\n\r\nwhat do you think?\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"nitro52"}}