[jboss-jira] [JBoss JIRA] Updated: (AS7-1685) Management layer doesn't reflect true handler attributes
Stan Silvert (JIRA)
jira-events at lists.jboss.org
Tue Aug 30 15:20:26 EDT 2011
[ https://issues.jboss.org/browse/AS7-1685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stan Silvert updated AS7-1685:
------------------------------
Description:
In the logging subsystem, the management operations are defined in LoggingSubsystemProviders.java.
The attributes defined for each handler type don't always reflect the real attributes that are available.
For example, if I go into the CLI and ask to read the resource description for an async handler, I get:
{code}
[standalone at localhost:9999 async-handler=ASYNC] :read-resource-description
{
"outcome" => "success",
"result" => {
"description" => "Defines a handler which writes to the sub-handlers in an asynchronous thread. Used for handlers which introduce a substantial amount of lag.",
"attributes" => {
"name" => {
"type" => STRING,
"description" => "The handler's name.",
"access-type" => "read-only",
"storage" => "configuration"
},
"level" => {
"type" => STRING,
"description" => "The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.",
"access-type" => "read-only",
"storage" => "configuration"
},
"encoding" => {
"type" => STRING,
"description" => "The character encoding used by this Handler.",
"access-type" => "read-only",
"storage" => "configuration"
},
"filter" => {
"type" => STRING,
"description" => "Defines a simple filter type.",
"access-type" => "read-only",
"storage" => "configuration"
},
"formatter" => {
"type" => STRING,
"description" => "Defines a formatter.",
"access-type" => "read-only",
"storage" => "configuration"
},
"autoflush" => {
"type" => BOOLEAN,
"description" => "Automatically flush after each write.",
"access-type" => "read-only",
"storage" => "configuration"
},
"handler" => {
"type" => LIST,
"value-type" => STRING,
"description" => "The Handlers associated with this Logger.",
"access-type" => "read-only",
"storage" => "configuration"
},
"queue-length" => {
"type" => STRING,
"description" => "The queue length to use before flushing writing",
"access-type" => "read-only",
"storage" => "configuration"
},
"overflow-action" => {
"type" => STRING,
"description" => "Specify what action to take when the overflowing. The valid options are 'block' and 'discard'",
"access-type" => "read-only",
"storage" => "configuration"
}
}
}
}
{code}
Clearly, an async handler doesn't accept all of those attributes. If I add the autoflush attribute to my standalone.xml then I will get an error on startup.
{code:xml}
<async-handler name="ASYNC" autoflush="true">
<level name="INFO"/>
<queue-length value="512"/>
<overflow-action value="BLOCK"/>
</async-handler>
{code}
Furthermore, there is a discrepancy in which attributes are required. Looking at autoflush again, LoggingSubsystemProviders.java says that this attribute is not required. But if I try to create a console handler without this attribute I will get an exception.
{code}
[standalone at localhost:9999 console-handler=MYCONSOLE] :add(name=MYCONSOLE,level=INFO)
{
"outcome" => "failed",
"failure-description" => "Operation handler failed: java.lang.IllegalArgumentException",
"rolled-back" => true
}
[standalone at localhost:9999 console-handler=MYCONSOLE] :add(name=MYCONSOLE,level=INFO,autoflush=true)
{"outcome" => "success"}
{code}
So each attribute needs to be checked to see if it is really required or not. Once this is fixed in LoggingSubsystemProviders.java I can go in and fix this in the console.
was:
In the logging subsystem, the management operations are defined in LoggingSubsystemProviders.java.
The attributes defined for each handler type don't always reflect the real attributes that are available.
For example, if I go into the CLI and ask to read the resource description for an async handler, I get:
[standalone at localhost:9999 async-handler=ASYNC] :read-resource-description
{
"outcome" => "success",
"result" => {
"description" => "Defines a handler which writes to the sub-handlers in an asynchronous thread. Used for handlers which introduce a substantial amount of lag.",
"attributes" => {
"name" => {
"type" => STRING,
"description" => "The handler's name.",
"access-type" => "read-only",
"storage" => "configuration"
},
"level" => {
"type" => STRING,
"description" => "The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.",
"access-type" => "read-only",
"storage" => "configuration"
},
"encoding" => {
"type" => STRING,
"description" => "The character encoding used by this Handler.",
"access-type" => "read-only",
"storage" => "configuration"
},
"filter" => {
"type" => STRING,
"description" => "Defines a simple filter type.",
"access-type" => "read-only",
"storage" => "configuration"
},
"formatter" => {
"type" => STRING,
"description" => "Defines a formatter.",
"access-type" => "read-only",
"storage" => "configuration"
},
"autoflush" => {
"type" => BOOLEAN,
"description" => "Automatically flush after each write.",
"access-type" => "read-only",
"storage" => "configuration"
},
"handler" => {
"type" => LIST,
"value-type" => STRING,
"description" => "The Handlers associated with this Logger.",
"access-type" => "read-only",
"storage" => "configuration"
},
"queue-length" => {
"type" => STRING,
"description" => "The queue length to use before flushing writing",
"access-type" => "read-only",
"storage" => "configuration"
},
"overflow-action" => {
"type" => STRING,
"description" => "Specify what action to take when the overflowing. The valid options are 'block' and 'discard'",
"access-type" => "read-only",
"storage" => "configuration"
}
}
}
}
Clearly, an async handler doesn't accept all of those attributes. If I add the autoflush attribute to my standalone.xml then I will get an error on startup.
<async-handler name="ASYNC" autoflush="true">
<level name="INFO"/>
<queue-length value="512"/>
<overflow-action value="BLOCK"/>
</async-handler>
Furthermore, there is a discrepancy in which attributes are required. Looking at autoflush again, LoggingSubsystemProviders.java says that this attribute is not required. But if I try to create a console handler without this attribute I will get an exception.
[standalone at localhost:9999 console-handler=MYCONSOLE] :add(name=MYCONSOLE,level=INFO)
{
"outcome" => "failed",
"failure-description" => "Operation handler failed: java.lang.IllegalArgumentException",
"rolled-back" => true
}
[standalone at localhost:9999 console-handler=MYCONSOLE] :add(name=MYCONSOLE,level=INFO,autoflush=true)
{"outcome" => "success"}
So each attribute needs to be checked to see if it is really required or not. Once this is fixed in LoggingSubsystemProviders.java I can go in and fix this in the console.
> Management layer doesn't reflect true handler attributes
> --------------------------------------------------------
>
> Key: AS7-1685
> URL: https://issues.jboss.org/browse/AS7-1685
> Project: Application Server 7
> Issue Type: Bug
> Components: Logging
> Affects Versions: 7.0.1.Final
> Reporter: Stan Silvert
> Assignee: James Perkins
>
> In the logging subsystem, the management operations are defined in LoggingSubsystemProviders.java.
> The attributes defined for each handler type don't always reflect the real attributes that are available.
> For example, if I go into the CLI and ask to read the resource description for an async handler, I get:
> {code}
> [standalone at localhost:9999 async-handler=ASYNC] :read-resource-description
> {
> "outcome" => "success",
> "result" => {
> "description" => "Defines a handler which writes to the sub-handlers in an asynchronous thread. Used for handlers which introduce a substantial amount of lag.",
> "attributes" => {
> "name" => {
> "type" => STRING,
> "description" => "The handler's name.",
> "access-type" => "read-only",
> "storage" => "configuration"
> },
> "level" => {
> "type" => STRING,
> "description" => "The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.",
> "access-type" => "read-only",
> "storage" => "configuration"
> },
> "encoding" => {
> "type" => STRING,
> "description" => "The character encoding used by this Handler.",
> "access-type" => "read-only",
> "storage" => "configuration"
> },
> "filter" => {
> "type" => STRING,
> "description" => "Defines a simple filter type.",
> "access-type" => "read-only",
> "storage" => "configuration"
> },
> "formatter" => {
> "type" => STRING,
> "description" => "Defines a formatter.",
> "access-type" => "read-only",
> "storage" => "configuration"
> },
> "autoflush" => {
> "type" => BOOLEAN,
> "description" => "Automatically flush after each write.",
> "access-type" => "read-only",
> "storage" => "configuration"
> },
> "handler" => {
> "type" => LIST,
> "value-type" => STRING,
> "description" => "The Handlers associated with this Logger.",
> "access-type" => "read-only",
> "storage" => "configuration"
> },
> "queue-length" => {
> "type" => STRING,
> "description" => "The queue length to use before flushing writing",
> "access-type" => "read-only",
> "storage" => "configuration"
> },
> "overflow-action" => {
> "type" => STRING,
> "description" => "Specify what action to take when the overflowing. The valid options are 'block' and 'discard'",
> "access-type" => "read-only",
> "storage" => "configuration"
> }
> }
> }
> }
> {code}
> Clearly, an async handler doesn't accept all of those attributes. If I add the autoflush attribute to my standalone.xml then I will get an error on startup.
> {code:xml}
> <async-handler name="ASYNC" autoflush="true">
> <level name="INFO"/>
> <queue-length value="512"/>
> <overflow-action value="BLOCK"/>
> </async-handler>
> {code}
> Furthermore, there is a discrepancy in which attributes are required. Looking at autoflush again, LoggingSubsystemProviders.java says that this attribute is not required. But if I try to create a console handler without this attribute I will get an exception.
> {code}
> [standalone at localhost:9999 console-handler=MYCONSOLE] :add(name=MYCONSOLE,level=INFO)
> {
> "outcome" => "failed",
> "failure-description" => "Operation handler failed: java.lang.IllegalArgumentException",
> "rolled-back" => true
> }
> [standalone at localhost:9999 console-handler=MYCONSOLE] :add(name=MYCONSOLE,level=INFO,autoflush=true)
> {"outcome" => "success"}
> {code}
> So each attribute needs to be checked to see if it is really required or not. Once this is fixed in LoggingSubsystemProviders.java I can go in and fix this in the console.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list