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

Ability to dynamically change loglevel #84

Open
rentallect opened this issue Oct 19, 2021 · 3 comments
Open

Ability to dynamically change loglevel #84

rentallect opened this issue Oct 19, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@rentallect
Copy link
Member

At initialization, the loglevel is set based on how the ZITI_AGENT_LOGLEVEL env var is configured. It is sometimes necessary to increase the verbosity of the logging (for trouble shooting), and then decease it later. We need the ability to do so without restarting the agent.

@rentallect rentallect added the enhancement New feature or request label Oct 19, 2021
@rentallect
Copy link
Member Author

This snippet shows that if we give each transport a name, keyed by the name, then we can have access to it via ref (since the logger object is inaccessible directly). The agent's REST API would then expose an endpoint able to seek out the "console" transport ref, and then alter its loglevel.

var self = this;
var keyBy = require('lodash.keyby');
self.logger = self.winston.createLogger({
        levels:self.winston.config.syslog.levels
        ,transports:
            [
                new self.winston.transports.Console({
                    level: self.config.console.level.ref
                    ,formatter: self._consoleLogFormatter
                    ,name: 'console'
                })
            ]
    });

    self.transports = keyBy(self.logger.transports,"name");
    self.transports.console.level = 'info';

@rentallect rentallect self-assigned this Dec 7, 2023
@qrkourier
Copy link
Member

I believe this feature was added.

@rentallect
Copy link
Member Author

@qrkourier dynamic client-side log-level adjustments shipped a while ago, but this issue is about dynamic changes to the Bootstrapper's log-level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants