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

undefined method `add_appender' for an instance of SemanticLogger::Logger #289

Open
rgaufman opened this issue Jul 12, 2024 · 1 comment

Comments

@rgaufman
Copy link

Both ChatGPT and Claude seem to suggest this syntax whenever you need to log only specific things to a separate file:

# Global logger
@logger = SemanticLogger['global']
SemanticLogger.add_appender(io: $stdout, formatter: :color)
SemanticLogger.add_appender(file_name: 'server.log', formatter: :default)

# Specific Logger
email_logger = SemanticLogger['specific']
email_logger.add_appender(file_name: 'emails.log', formatter: :default, level: :info)
email_logger.log("email contents")

It seems like something that would be useful to add? - otherwise, how would one achieve something like this?

@reidmorrison
Copy link
Owner

Appenders are global, to control what appender receives what messages it uses filters: https://logger.rocketjob.io/filtering.html

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

No branches or pull requests

2 participants