Bug 915835 - CLI: "pattern" and "replacement" should be required when creating logging filter
Summary: CLI: "pattern" and "replacement" should be required when creating logging filter
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER4
: EAP 6.1.0
Assignee: James Perkins
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-26 15:31 UTC by Petr Kremensky
Modified: 2013-07-23 18:46 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker AS7-6713 0 Major Resolved CLI: "pattern" and "replacement" should be required when creating logging filter 2014-08-13 10:50:54 UTC

Description Petr Kremensky 2013-02-26 15:31:31 UTC
I am able to set filter attribute without "pattern" and "replacement" although they are not nillable.

calling:
/subsystem=logging/console-handler=CONSOLE:write-attribute(name=filter, value={replace => {"replace-all" => true}})

will create useless filter:
"filter" => {"replace" => {
    "replace-all" => true,
    "pattern" => "undefined",
    "replacement" => "undefined"
}}
"filter-spec" => "substituteAll(\"undefined\",\"undefined\")"

only "replace-all" is actually required now:
[standalone@localhost:9999 /] /subsystem=logging/console-handler=CONSOLE:update-properties(filter={replace => {"pattern" => "JBAS","replacement" => "SABJ"}})
{
    "outcome" => "failed",
    "failure-description" => "JBAS014749: Operation handler failed: null",
    "rolled-back" => true
}

Comment 1 James Perkins 2013-03-08 00:30:08 UTC
Need an upstream JIRA.

Comment 2 JBoss JIRA Server 2013-03-12 09:55:39 UTC
Chao Wang <chaowan> made a comment on jira AS7-6713

patch to check "pattern" and "replacement" values can't be undefined from LoggingWriteAttributeHandler.validateUpdatedModel()

Comment 3 JBoss JIRA Server 2013-03-14 00:11:23 UTC
James Perkins <jperkins> made a comment on jira AS7-6713

Writing a fix for this and testing various other filters I think I opened Pandora's box :-). I'll suggest for a workaround use the {{filter-spec}} expressions instead. I'll also note, I should probably document those.

Comment 4 JBoss JIRA Server 2013-03-14 01:46:46 UTC
Chao Wang <chaowan> made a comment on jira AS7-6713

wrt filter-spec expression, I tried to configure something similar, but unsuccessfully as described in https://community.jboss.org/thread/222386

Comment 6 Petr Kremensky 2013-04-12 11:16:37 UTC
Behaviour described in description is fixed. There is new info message that filter attribute is deprecated and thus should not be used. Closing Pandora's box :). 

Verified with EAP 6.1 ER4


Note You need to log in before you can comment on or make changes to this bug.