| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | |
| | | import java.util.zip.ZipEntry; |
| | | import java.util.zip.ZipOutputStream; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | |
| | | /** |
| | | * This class implements a post rotation action that compresses |
| | |
| | | */ |
| | | public class ZIPAction implements PostRotationAction |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | private File originalFile; |
| | | private File newFile; |
| | |
| | | return true; |
| | | } catch(IOException ioe) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ioe); |
| | | } |
| | | logger.traceException(ioe); |
| | | if (inputStreamOpen) |
| | | { |
| | | try |
| | |
| | | } |
| | | catch (Exception fe) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, fe); |
| | | } |
| | | logger.traceException(fe); |
| | | // Cannot do much. Ignore. |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (Exception ze) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ze); |
| | | } |
| | | logger.traceException(ze); |
| | | // Cannot do much. Ignore. |
| | | } |
| | | } |