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

enhancement: allow setting "logger name" a-la-Python #24

Open
marcelloromani opened this issue Nov 5, 2019 · 1 comment
Open

enhancement: allow setting "logger name" a-la-Python #24

marcelloromani opened this issue Nov 5, 2019 · 1 comment

Comments

@marcelloromani
Copy link

In Python I can do something like

logger = logging.getLogger("foobar")

and foobar gets printed in every line logged by that object.

One use case where this is useful is in Lambdas: by initializing the logger with the lambda name, one can easily filter / see which lambda function emitted the line when using a log aggregation tool, such as CloudWatch or ElasticSearch.

I haven't found a way of obtaining the same with rlog.

Happy to contribute with a PR if needs be.

@marcelloromani
Copy link
Author

As (maybe not particularly elegant) workaround, I found the time format can be used:

Setting RLOG_TIME_FORMAT to 2006-01-02 15:04:05.000 $lambda_name does the trick.

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

1 participant