-
Notifications
You must be signed in to change notification settings - Fork 296
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
Add an external Log4J2 configuration file #1031
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FSCrawler comes with a default logger configuration which can be found in the FSCrawler installation dir as `config/log4j2.xml` file. You can modify it to suit your needs. You can control where FSCrawler will store the logs by setting the `LOG_DIR` Java property. ```sh FS_JAVA_OPTS="-DLOG_DIR=path/to/logs_dir" bin/fscrawler ``` By default, it will log everything in the `logs` directory inside the installation folder. Two log files are generated: * One is used to log FSCrawler code execution, named `fscrawler.log`. It's automatically rotated every day or after 20mb of logs and gzipped. Logs are removed after 7 days. * One is used to trace all information about documents, named `documents.log`. It's automatically rotated every day or after 20mb of logs and gzipped. Logs are removed after 7 days. You can change this strategy by modifying the `config/log4j2.xml` file. Please read [Log4J2 documentation](https://logging.apache.org/log4j/2.x/manual/index.html) on how to configure Log4J. Closes #536. Closes #1028.
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11. |
dadoonet
added a commit
that referenced
this pull request
Nov 6, 2020
We change the way we are logging in `documents.log`: * `INFO` level by default instead of `DEBUG`. * Add the document `_id` to the log * Add the documentLogger to the BulkListeners so we at least trace which `_id` has failed Follow up for #1031
dadoonet
added a commit
that referenced
this pull request
Nov 9, 2020
Simplify `log4j2.xml` for the end user. Now you can control where FSCrawler will store the logs and the log levels by setting `LOG_DIR`, `LOG_LEVEL` and `DOC_LEVEL` Java properties. ```sh FS_JAVA_OPTS="-DLOG_DIR=path/to/logs_dir -DLOG_LEVEL=trace -DDOC_LEVEL=debug" bin/fscrawler ``` In the future we might remove the `--debug` and `--trace` CLI options. Also adds a banner! :) Follow up for #1031
dadoonet
added a commit
that referenced
this pull request
Dec 11, 2023
As we are supporting now the standard way for logging (see #1031), we can remove support for `--debug` and `--trace`. Instead users can use: ```sh FS_JAVA_OPTS="-DLOG_LEVEL=debug" bin/fscrawler ``` or ```sh FS_JAVA_OPTS="-DLOG_LEVEL=trace" bin/fscrawler ``` That's producing the same effect at the end in a much more standard way.
dadoonet
added a commit
that referenced
this pull request
Dec 12, 2023
As we are supporting now the standard way for logging (see #1031), we can remove support for `--debug` and `--trace`. Instead users can use: ```sh FS_JAVA_OPTS="-DLOG_LEVEL=debug" bin/fscrawler ``` or ```sh FS_JAVA_OPTS="-DLOG_LEVEL=trace" bin/fscrawler ``` That's producing the same effect at the end in a much more standard way.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FSCrawler comes with a default logger configuration which can be found in the FSCrawler installation dir as
config/log4j2.xml
file.You can modify it to suit your needs.
You can control where FSCrawler will store the logs by setting the
LOG_DIR
Java property.FS_JAVA_OPTS="-DLOG_DIR=path/to/logs_dir" bin/fscrawler
By default, it will log everything in the
logs
directory inside the installation folder.Two log files are generated:
fscrawler.log
. It's automaticallyrotated every day or after 20mb of logs and gzipped. Logs are removed after 7 days.
documents.log
. It's automaticallyrotated every day or after 20mb of logs and gzipped. Logs are removed after 7 days.
You can change this strategy by modifying the
config/log4j2.xml
file.Please read Log4J2 documentation on how to configure Log4J.
Closes #536.
Closes #1028.