Customizing Viewpoint > Customizing logging

3.7 Customizing logging

By default, Viewpoint sends log files to the Viewpoint home directory. However, you can modify where the logs are sent, and you can change the logging verbosity by following these instructions.

Viewpoint uses Grails logging. For information, see http://grails.org/doc/latest/guide/single.html#logging.

To customize logging in Viewpoint

  1. Copy and paste the following into the log4jConfig.groovy file in the Viewpoint home directory:
  2. log4j = {

         //ORDER MATTERS, PUT APPENDERS AT THE BEGINNING

         appenders {

         // (EXAMPLE) Set logging to the console.

              //console name: 'stdout', threshold: org.apache.log4j.Level.INFO, layout: pattern(conversionPattern: '%d{dd MMM yyyy HH:mm:ss,SSS} %5p %c{1}:%L - %m%n')

         // Setup rolling log files and set the location of the log.

              rollingFile name: 'vpLog', file: "/opt/viewpoint/ViewpointLog.log", maxFileSize: '500KB'

         }

     

         //ORDER MATTERS, PUT LOGGERS NEXT

         error 'org.codehaus.groovy.grails.web.servlet', // controllers

                   'org.codehaus.groovy.grails.web.pages', // GSP

                   'org.codehaus.groovy.grails.web.sitemesh', // layouts

                   'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping

                   'org.codehaus.groovy.grails.web.mapping', // URL mapping

                   'org.codehaus.groovy.grails.commons', // core / classloading

                   'org.codehaus.groovy.grails.plugins', // plugins

                   'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration

                   'org.springframework',

                   'org.hibernate',

                   'net.sf.ehcache.hibernate'

     

         warn 'org.mortbay.log',

                   'grails.app'

     

    //   info 'grails.app.com.ace.viewpoint'

     

     

         //ORDER MATTERS, PUT ROOT CLOSURE AT THE END

         //set the overall level here (fatal, error, warn, info, debug, trace)

         root {

              error 'vpLog' // , 'stdout'

              //DON'T USE MULTIPLE LINES IN HERE, PUT EVERYTHING ON ONE LINE ABOVE

        }

    }

  3. Customize the settings to meet your specifications. For information on how to customize, see http://grails.org/doc/latest/guide/single.html#logging.
  4. As part of your logging customization, you can specify the following Viewpoint packages:

    Value Description
    com.cri

    This is the general package for all Viewpoint server code. This will log all server interaction with the Viewpoint Web server.

    com.cri.security This is the logger for all security packages. This is important for authentication and authorization testing.
    com.ace This is the logger for external Java API classes. This includes Java code that has been validated for external customer consumption. Classes include MoabJob, MoabNode, Reservation, and so forth. See the Moab Java API for more information.
    com.Moab This is the logger for internal Java API classes. Classes include VPCs, low-level Moab consumption, etc. This is the logger that shows what Moab commands are sent and the associated output.
    org.codehaus.groovy.grails.web.servlet This is the logger for controllers.
    org.codehaus.groovy.grails.web.pages This is the logger for GSP.
    org.codehaus.groovy.grails.web.sitemesh This is the logger for layouts.
    org.codehaus.groovy.grails.web.mapping.filter This is the logger for URL mapping.
    org.codehaus.groovy.grails.web.mapping This is the logger for URL mapping.
    org.codehaus.groovy.grails.commons This is the logger for classloading.
    org.codehaus.groovy.grails.plugins This is the logger for plugins.
    org.codehaus.groovy.grails.orm.hibernate This is the logger for hibernate integration.
    org.springframework ---
    org.hibernate ---
    net.sf.ehcache.hibernate ---
  5. Save your changes to the logj4Config.groovy file.

Related topics