# How to setup logging?

  1. Import com.iteration3.smile.appLogger

    import com.iteration3.smile.appLogger
    
  2. Usage:

    • to log an INFO message
    appLogger.info(s"Lottery - ${input.lotteryName} created successfully.")
    
    • to log an ERROR message
    appLogger.error("Invalid input ...")
    

    By default, log messages are written into logs/application.log file

    2020-01-02 16:55:55.724 - [INFO] - from application in scala-execution-context-global-725
    Lottery - NewYear_2020 created successfully.
    

    Advance usage:

    • To customize log configuration, edit application-logger.xml (located inside project's conf folder). More details here: How to log to a custom logger file?

    • For environment specific log configuration prefix application-logger.xml with environment name.

      For example to set up log configuration for "stage" environment, create stage.application-logger.xml