2014-01-08 3 views
0

В моей JBoss 6.1.0 финале, как я хочу, чтобы войти в 30 дней ..Как вращать файл войти JBoss AS 6

в JBoss-logging.xml есть размер-поворотно-файл-обработчик, который я не хочу .. мне нужно повернуть файл журнала каждый день .. как можно изменить конфигурацию журнала

моя конфигурация протоколирование -

<periodic-rotating-file-handler 
    file-name="${jboss.server.log.dir}/server.log" 
    name="FILE" 
    autoflush="true" 
    append="true" 
    suffix="..yyyy-MM-dd"> <!-- To roll over at the top of each hour, use ".yyyy-MM-dd-HH" instead --> 

    <error-manager> 
    <only-once/> 
    </error-manager> 

    <formatter> 
    <!-- To revert back to simple stack traces without JAR versions, change "%E" to "%e" below. --> 
    <!-- Uncomment this to get the class name in the log as well as the category 
    <pattern-formatter pattern="%d %-5p [%c] %C{1} (%t) %s%E%n"/> 
    --> 
    <!-- Uncomment this to log without the class name in the log --> 
    <pattern-formatter pattern="%d %-5p [%c] (%t) %s%E%n"/> 
    </formatter> 

пожалуйста, помогите мне

ответ

1

Чтобы сохранить 30 дней журналов с одного файла на каждый день попробуйте следующее ...

<periodic-rotating-file-handler 
    file-name="${jboss.server.log.dir}/server.log" 
    name="FILE" 
    autoflush="true" 
    append="true" 
    suffix=".dd"> <!-- To roll over at the top of each hour, use ".yyyy-MM-dd-HH" instead --> 

    <error-manager> 
    <only-once/> 
    </error-manager> 

    <formatter> 
    <!-- To revert back to simple stack traces without JAR versions, change "%E" to "%e" below. --> 
    <!-- Uncomment this to get the class name in the log as well as the category 
    <pattern-formatter pattern="%d %-5p [%c] %C{1} (%t) %s%E%n"/> 
    --> 
    <!-- Uncomment this to log without the class name in the log --> 
    <pattern-formatter pattern="%d %-5p [%c] (%t) %s%e%n"/> 
    </formatter> 
</periodic-rotating-file-handler> 
+0

Спасибо за ответ, я попробую –

0

Чтобы понять параметр суффиксов вы должны смотреть на источник PeriodicRotatingFileHandler.java и удивления.

setSuffix выполняет итерацию над символами суффикса, создает объект Period для каждого, и последний принимается. Итак, если суффикс заканчивается на m, берется Period.MINUTE.

Смежные вопросы