| | |
| | | import org.opends.server.util.TimeThread; |
| | | import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugVerbose; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCaught; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.messages.LoggerMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | |
| | | implements ServerShutdownListener, TextWriter, |
| | | ConfigurationChangeListener<SizeLimitLogRotationPolicyCfg> |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | private static final String UTF8_ENCODING= "UTF-8"; |
| | | |
| | | private CopyOnWriteArrayList<RotationPolicy> rotationPolicies = |
| | |
| | | sizePolicy.currentConfig.removeSizeLimitChangeListener(this); |
| | | } |
| | | } |
| | | |
| | | this.rotationPolicies.clear(); |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | if (debugEnabled()) |
| | | { |
| | | debugVerbose("%d files deleted by rentention policy", |
| | | TRACER.debugVerbose("%d files deleted by rentention policy", |
| | | numFilesDeleted); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | if(debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | errorHandler.handleCloseError(e); |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if(debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | errorHandler.handleOpenError(currentFile, e); |
| | | } |
| | | |
| | |
| | | // new RotationActionThread(newFile, actions, configEntry); |
| | | //rotThread.start(); |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Log file %s rotated and renamed to %s", |
| | | currentFile, newFile); |
| | | } |
| | | |
| | | totalFilesRotated++; |
| | | lastRotationTime = TimeThread.getTime(); |
| | | } |