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

Add logging to zentity #66

Open
davemoore- opened this issue Jan 28, 2021 · 0 comments
Open

Add logging to zentity #66

davemoore- opened this issue Jan 28, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@davemoore-
Copy link
Member

zentity should take advantage of the logging architecture of Elasticsearch to aid troubleshooting. This can be implemented as needed instead of creating a dedicated feature branch for logging.

To implement this:

  1. Add the following property to any class that will use the logger (substituting CLASS_NAME with the name of the class):
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

class MyClass {
   private static final Logger logger = LogManager.getLogger(MyClass.class);
}
  1. Invoke the logger's methods as needed:
logger.catching(e);
logger.fatal(message);
logger.error(message);
logger.warn(message);
logger.info(message);
logger.debug(message);
logger.trace(message);
  1. Add the following configurations to the elasticsearch.yml file of each node to write the log messages to the Elasticsearch log files:
logger.org.elasticsearch.plugin.zentity: DEBUG
logger.io.zentity: DEBUG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant