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

namespace scope log logger to crawl job #226

Merged
merged 1 commit into from
Jan 4, 2019

Conversation

nlevitt
Copy link
Contributor

@nlevitt nlevitt commented Jan 4, 2019

This is a bad bug. Stupid, too. When multiple crawls are running with
DecideRuleSequence.logToFile enabled, all the scope log lines from all
the crawls are going to all the scope logs for all the crawls. It was
because of this line:

Logger logger = Logger.getLogger(logName + ".log");

logName here is "scope" normally, for all crawl jobs.
Logger is shared across the whole java vm, so
Logger.getLogger("scope.log") returns the same logger for every
crawl job. Each time a crawl starts, it adds another output file to
the logger.

Fix is to give the logger a name specific to the crawl job.

😳🥵🥶💩

This is a bad bug. Stupid, too. When multiple crawls are running with
`DecideRuleSequence.logToFile` enabled, all the scope log lines from all
the crawls are going to all the scope logs for all the crawls. It was
because of this line:

    Logger logger = Logger.getLogger(logName + ".log");

`logName` here is "scope" normally, for all crawl jobs.
`Logger` is shared across the whole java vm, so
`Logger.getLogger("scope.log")` returns the same logger for every
crawl job. Each time a crawl starts, it adds another output file to
the logger.

Fix is to give the logger a name specific to the crawl job.

😳🥵🥶💩
@galgeek galgeek merged commit a40c466 into internetarchive:master Jan 4, 2019
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

Successfully merging this pull request may close these issues.

2 participants