我有一个域集群wildlfy并且在每个节点上我在每个节点上有2个或更多VM我想在域/日志中的同一文件上写入所有服务器节点以使其工作:
<periodic-size-rotating-file-handler name="FILE_BACKEND" autoflush="true">
<formatter>
<named-formatter name="PATTERN_BACKEND"/>
</formatter>
<rotate-size value="5k"/>
<max-backup-index value="10"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
<file relative-to="custom.jboss.server.log.dir" path="server.log"/>
</periodic-size-rotating-file-handler>
<periodic-size-rotating-file-handler name="FILE_PORTAL" autoflush="true">
<formatter>
<named-formatter name="PATTERN_PORTAL"/>
</formatter>
<rotate-size value="5k"/>
<max-backup-index value="10"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
<file relative-to="custom.jboss.server.log.dir" path="server.log"/>
</periodic-size-rotating-file-handler>
<periodic-size-rotating-file-handler name="FILE" autoflush="true">
<formatter>
<named-formatter name="PATTERN_SERVER"/>
</formatter>
<rotate-size value="5k"/>
<max-backup-index value="10"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
<file relative-to="custom.jboss.server.log.dir" path="server.log"/>
</periodic-size-rotating-file-handler>
<periodic-rotating-file-handler name="AOF_ERRORS_FILE">
<level name="ERROR"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<file relative-to="custom.jboss.server.log.dir" path="errors.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
<periodic-size-rotating-file-handler name="AOF_PERFS_FILE">
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="aof_perfs.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-size-rotating-file-handler>
<logger category="com.arjuna">
<level name="WARN"/>
</logger>
<logger category="org.jboss.security">
<level name="ERROR"/>
</logger>
<logger category="org.jboss.as.web.security">
<level name="ERROR"/>
</logger>
<logger category="org.apache.pdfbox.pdfparser">
<level name="ERROR"/>
</logger>
<logger category="com.real.aof.interceptor.PerformanceInterceptor" use-parent-handlers="false">
<level name="INFO"/>
<handlers>
<handler name="AOF_PERFS_FILE"/>
</handlers>
</logger>
<logger category="com.real.aof" use-parent-handlers="false">
<level name="INFO"/>
<handlers>
<handler name="FILE_BACKEND"/>
</handlers>
</logger>
<logger category="com.real.portal" use-parent-handlers="false">
<level name="INFO"/>
<handlers>
<handler name="FILE_PORTAL"/>
</handlers>
</logger>
<logger category="org.apache.tomcat.util.modeler">
<level name="WARN"/>
</logger>
<logger category="org.jboss.as.config">
<level name="WARN"/>
</logger>
<logger category="sun.rmi">
<level name="WARN"/>
</logger>
<logger category="jacorb">
<level name="WARN"/>
</logger>
<logger category="jacorb.config">
<level name="ERROR"/>
</logger>
<logger category="org.jgroups.protocols.UDP">
<level name="ERROR"/>
</logger>
<root-logger>
<level name="INFO"/>
<handlers>
<handler name="FILE_PORTAL"/>
<handler name="FILE_BACKEND"/>
<handler name="CONSOLE"/>
<handler name="FILE"/>
<handler name="AOF_ERRORS_FILE"/>
</handlers>
</root-logger>
<formatter name="PATTERN">
<pattern-formatter pattern="%d{mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
<formatter name="PATTERN_PORTAL">
<pattern-formatter pattern="PORTAL %d{mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
<formatter name="PATTERN_SERVER">
<pattern-formatter pattern="SERVER ${jboss.server.name} %d{mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
<formatter name="PATTERN_BACKEND">
<pattern-formatter pattern="BACKEND ${jboss.server.name} %d{mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
<formatter name="COLOR-PATTERN">
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
并在每个节点的host.xml中:
<servers>
<server name="server-one" group="main-server-group" auto-start="true">
<paths>
<path name="custom.jboss.server.log.dir" path="c:/dev/servers/wildfly-9.0.2.Final/domain/log" />
</server>
....
</servers>
问题是:旋转不工作...如果我通过jboss.server.log.dir更改custom.jboss.log.dir将在每个服务器(vm)上创建server.log并且旋转将生效但是如果我重定向所有日志在域/日志中的所有日志都写在一个文件但旋转不起作用,我也尝试使用periodic-handler但它也不起作用
任何想法?