| | |
| | | private static class PublishRequest |
| | | { |
| | | public final LogRecord record; |
| | | public final LogErrorHandler handler; |
| | | public final LoggerErrorHandler handler; |
| | | |
| | | PublishRequest(LogRecord record, LogErrorHandler handler) |
| | | PublishRequest(LogRecord record, LoggerErrorHandler handler) |
| | | { |
| | | this.record = record; |
| | | this.handler = handler; |
| | |
| | | catch (Throwable t) { |
| | | // Forward exception to error handler |
| | | if (request != null && request.handler != null) { |
| | | LogErrorHandler handler= request.handler; |
| | | LoggerErrorHandler handler= request.handler; |
| | | handler.handleError(request.record, t); |
| | | } |
| | | } |
| | |
| | | // want shutdown to start after we check for it, but before we queue |
| | | // request. |
| | | private synchronized void publishAsynchronously(LogRecord record, |
| | | LogErrorHandler handler) |
| | | LoggerErrorHandler handler) |
| | | { |
| | | // If shutting down reject, otherwise publish (if we have a publisher!) |
| | | if (isShuttingDown()) { |
| | |
| | | * @param record the log record to publish. |
| | | * @param handler the error handler to use if an error occurs. |
| | | */ |
| | | public void publish(LogRecord record, LogErrorHandler handler) |
| | | public void publish(LogRecord record, LoggerErrorHandler handler) |
| | | { |
| | | // No publisher? Off to the bit bucket. |
| | | if (publisher != null) { |