1 Reply Latest reply on Feb 1, 2020 5:11 AM by abhijithumbe

    Mask Specific text in Jboss server.log

    pratiksc

      Hello Team

       

      I am new to Jboss and trying Learn/Understand it with the best I can. We are using Jboss EAP 7.1 to run our Java application.

      Our setup is standalone and has lot of system properties set in the standalone.xml file, which are being used in the application to perform various tasks.

      These system properties are being printed in the server.log file and the logs are being forwarded to graylog. Is it possible i can mask the system properties which are being printed in the log file so it does not print the sensitive text in the server.log file? Can Jboss logging help with some search and replace text configuration so it replaces the sensitive text to say xxxxx?

       

      Your response is highly appreciated.

       

      Thank You

      Pat

        • 1. Re: Mask Specific text in Jboss server.log
          abhijithumbe

          In EAP 6.1.1 onwards, filter expressions are introduced, use <filter-spec> to remove specific logging messages from server.log/console log. With below CLI command you can skip log messages with string "JBAS000000|JBAS000001|JBAS000002|JBAS000003" from being captured in console log. Similar to this you can configure filter for any handler.

           

          CLI command:

          ~~~

          /subsystem=logging/console-handler=CONSOLE:write-attribute(name=filter-spec,value=not(match("Set  name after initialization|JBAS000000|JBAS000001|JBAS000002|JBAS000003")))

          ~~~

           

          XML:

          ~~~

          <filter-spec value="match(&quot;Set name after initialization|JBAS000000|JBAS000001|JBAS000002|JBAS000003&quot;)"/>

          ~~~