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

Logger incorrectly use the label as the logging level #38

Open
reivaxxavier opened this issue May 25, 2023 · 1 comment
Open

Logger incorrectly use the label as the logging level #38

reivaxxavier opened this issue May 25, 2023 · 1 comment
Labels
Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.

Comments

@reivaxxavier
Copy link

Hello there!

I'm encountering a difficulty related to logging in subfinder, which seems to be connected to how gologger handles label and log level. In the piece of code provided below, it seems that whenever an event that includes a label value is logged, this value gets converted to log level during formatting. Is there a specific reasoning behind this design decision?

To illustrate, when I operate subfinder with verbose log level configuration, I encounter numerous logs with a log level that my external logging system cannot process.

{"level":"dnsdumpster","msg":"rate-limited-proxy-108-177-77-100.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"code.l.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"captive.adservice.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"rate-limited-proxy-108-177-64-100.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"google-proxy-66-249-83-100.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"rate-limited-proxy-108-177-73-0.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"rate-limited-proxy-108-177-73-100.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"colab-sandbox.research.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"tensorboard-staging.cloud.google.com","timestamp":"2023-05-25T14:07:57+0000"}
{"level":"dnsdumpster","msg":"mail.google.com","timestamp":"2023-05-25T14:07:57+0000"}

data["level"] = label

@gnuletik
Copy link

gnuletik commented May 27, 2023

The main issue should be that the Label function should take a levels.Level enum instead of a raw string to avoid bad usage of the function.

The subfinder usage of gologger should be fixed in projectdiscovery/subfinder#848

@ehsandeep ehsandeep added the Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. label May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Projects
None yet
Development

No branches or pull requests

3 participants