Useful Groovy Scripts. Part 2. – hybrismart | SAP hybris under the hood

One Response

  1. Ivan

    Ivan

    Reply

    13 December 2017 at 07:38

    Actually I’m using a bit shorter code to add logger. Although it strongly related on Log4j2 (but it’s used on our project)

    def loggerCtx = org.apache.logging.log4j.LogManager.getContext(false)
    def loggingConfig = loggerCtx.getConfiguration()

    def specificConfig = new org.apache.logging.log4j.core.config.LoggerConfig(“org.apache.http”, org.apache.logging.log4j.Level.ALL, true)
    loggingConfig.addLogger(“org.apache.http”, specificConfig)
    loggerCtx.updateLoggers()

Leave a Reply