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

ISPN-11153 When starting the server all failures should be handled #7734

Closed
wants to merge 1 commit into from

Conversation

diegolovison
Copy link
Contributor

loggingFile = new File(confDir, Server.DEFAULT_LOGGING_FILE);
} else if (!loggingFile.isAbsolute()) {
loggingFile = Paths.get(confDir.getPath(), loggingFile.getPath()).toFile();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of this code can fail so it makes no sense to move it inside the try/catch

@tristantarrant
Copy link
Member

I don't think that a broken logging configuration should fail the server.
I would move the logger initialization inside a method which would detect the error and programmatically set a "fallback" log4j configuration (showing >= INFO messages on STDOUT).

List<String> errors = new ArrayList<>(0);

// the listener call will be in the same getLogger thread
StatusConsoleListener listener = new StatusConsoleListener(Level.ERROR) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using the listener, you can inspect the logger output:
StatusLogger.getLogger().getStatusData() .stream() .filter(s -> s.getLevel().isMoreSpecificThan(Level.ERROR)) .forEach(// log to stderr );

@diegolovison
Copy link
Contributor Author

The bash won't be hanged. It will print only ERRROR messages to the output. That is default log4j configuration. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants