Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding custom logger to JBoss EAP 6.2 via CLI

I would like to have CLI command that will create following configuration in standalone.xml:

...
    <subsystem xmlns="urn:jboss:domain:logging:1.3">
     ...
        <custom-handler name="DB" class="com.jeefix.commons.logger.DatabaseHandler" module="com.jeefix">
            <level name="ALL"/>
            <formatter>
                <pattern-formatter pattern="%s%E%n"/>
            </formatter>
            <properties>
                <property name="jdbcUrl" value="${logger.database.url}"/>
                <property name="username" value="${logger.database.user}"/>
                <property name="password" value="${logger.database.password}"/>
                <property name="jdbcDriver" value="oracle.jdbc.driver.OracleDriver"/>
            </properties>
        </custom-handler>
    ...

I am able to create everything except list of properties via command:

/subsystem=logging/custom-handler=DB:add(name=DB,class=com.jeefix.commons.logger.DatabaseHandler,module=com.jeefx.dbappender,formatter=%s%E%n,level=ALL)

Question: How can I add list of properties?

like image 417
iskramac Avatar asked Mar 19 '23 11:03

iskramac


1 Answers

try

/subsystem=logging/custom-handler=server/:write-attribute(name=properties,value=[("jdbcUrl" => "your_jdbc_url"),("username" => "jdbc_user_name"),("password" => "jdbc_password"),("jdbcDriver" => "oracle.jdbc.driver.OracleDriver")])
like image 117
SubOptimal Avatar answered Mar 27 '23 15:03

SubOptimal