-
Notifications
You must be signed in to change notification settings - Fork 61
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
Use 'level' instead of 'severity' #17
Comments
It seems the level tag can be easily changed with the following code: import logging
from logging_loki import LokiHandler, emitter
emitter.LokiEmitter.level_tag = "level"
handler = LokiHandler(
url="<url>",
tags={"app": "<appname>"},
version="1",
)
logger = logging.getLogger("<loggername>")
logger.addHandler(handler)
logger.error(
"Something happened",
extra={"tags": {"service": "my-service"}},
) |
Hi, the logger only supports error I can send logs to Loki but I perform logger.info he does not write it to Loki |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Loki and Grafana use
level
as label to show the logging severity/verbose/levelname. It would be useful to replace the currentseverity
label withlevel
, as all queries and visualizations in Grafana would automatically pick up the log level.I can create a pull request if you like, but let me know if the current has a special purpose.
The text was updated successfully, but these errors were encountered: