[jboss-as7-dev] Question about Async logging

Ales Justin ales.justin at gmail.com
Thu Jun 23 11:29:57 EDT 2011


Looking at the code, I would say that's a bug.

        final EnumSet<Attribute> required = EnumSet.of(Attribute.FILE_NAME, Attribute.NAME);
        final int count = reader.getAttributeCount();
        for (int i = 0; i < count; i++) {
            requireNoNamespaceAttribute(reader, i);
            final String value = reader.getAttributeValue(i);
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            required.remove(attribute);
            switch (attribute) {
                case NAME: {
                    name = value;
                    break;
                }
                default:
                    throw unexpectedAttribute(reader, i);
            }
        }
        if (!required.isEmpty()) {
            throw missingRequired(reader, required);
        }

Since as you can see, FILE_NAME' value (if present) is never actually used / handled.

On Jun 23, 2011, at 8:22 AM, Andrig Miller wrote:

> I have looked over the JBoss logging XSD, and believe I have configured asynchronous logging correctly, but I'm getting a parse error.
> 
> Here is my configuration:
> 
> <subsystem xmlns="urn:jboss:domain:logging:1.0">
>             <periodic-rotating-file-handler name="FILE" autoflush="true">
>                 <level name="INFO"/>
>                 <formatter>
>                     <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
>                 </formatter>
>                 <file relative-to="jboss.server.log.dir" path="server.log"/>
>                 <suffix value=".yyyy-MM-dd"/>
>             </periodic-rotating-file-handler>
>             <async-handler name="ASYNC">
>                 <level name="INFO"/>
>                 <queue-length>1024</queue-length>
>                 <overflow-action>block</overflow-action>
>                 <subhandlers>FILE</subhandlers>
>             </async-handler>
>             <logger category="com.arjuna">
>                 <level name="WARN"/>
>             </logger>
>             <logger category="org.apache.tomcat.util.modeler">
>                 <level name="WARN"/>
>             </logger>
>             <logger category="sun.rmi">
>                 <level name="WARN"/>
>             </logger>
>             <root-logger>
>                 <level name="INFO"/>
>                 <handlers>
>                     <handler name="ASYNC"/>
>                 </handlers>
>             </root-logger>
>         </subsystem>
> 
> Here is the exception:
> 
> Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[51,13]
> Message: Missing required attribute(s): FILE_NAME
>     at org.jboss.as.controller.parsing.ParseUtils.missingRequired(ParseUtils.java:115)
>     at org.jboss.as.logging.LoggingSubsystemParser.parseAsyncHandlerElement(LoggingSubsystemParser.java:259)
>     at org.jboss.as.logging.LoggingSubsystemParser.readElement(LoggingSubsystemParser.java:149)
>     at org.jboss.as.logging.LoggingSubsystemParser.readElement(LoggingSubsystemParser.java:84)
>     at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:100)
>     at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
>     at org.jboss.as.controller.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:309)
>     at org.jboss.as.controller.parsing.StandaloneXml.readServerElement(StandaloneXml.java:163)
>     at org.jboss.as.controller.parsing.StandaloneXml.readElement(StandaloneXml.java:87)
>     at org.jboss.as.controller.parsing.StandaloneXml.readElement(StandaloneXml.java:75)
>     at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:100)
>     at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:59)
>     at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:105)
>     ... 5 more
> 
> I far as I can see there is no FILE_NAME required attribute, and the line and column number it gives is the start of the async-handler tag in the configuration above.
> 
> Any ideas?
> 
> Thanks.
> 
> Andy
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20110623/d470aabe/attachment.html 


More information about the jboss-as7-dev mailing list