+ Reply to Thread
Results 1 to 4 of 4

Thread: Using Logging in Symphony DE

  1. #1
    Ajith's Avatar
    Ajith is offline Symphony DE Moderator
    Join Date
    February 28th, 2008
    Location
    Markham, Ontario
    Posts
    108
    Blog Entries
    2
    Downloads
    10
    Uploads
    0

    Default Using Logging in Symphony DE

    Scenario

    You want to get an idea of how your workload data moves between the client part of your application and the back-end service part of your application.

    Background

    Symphony DE uses log4cxx (version 0.9.7) to do logging. If you are familiar with log4j for java, log4cxx is the C++ version. Both log4j and log4cxx are enabled using log4j.properties files.

    Symphony DE provides log4j.properties files for the client api library, sd, ssm, sim, agent and command line utilities. These files are located in the /conf directory.

    The default log level is INFO. At this level Symphony DE logs error, warning and information messages.

    Enable DEBUG logging for the client API

    1. List the /conf directory.
    Code:
    agent.log4j.properties
    api.log4j.properties
    cli.log4j.properties
    sd.log4j.properties
    sim.log4j.properties
    ssm.log4j.properties
    
    2. Open the api.log4j.properties file and modify the following line and save.

    log4j.rootLogger=INFO, API

    to

    log4j.rootLogger=DEBUG, API

    3. Run your application. You can use symping. A file called api.{hostname}.log will appear in the current directory.

    Enable DEBUG logging for the SD using the log4j file

    1. The logging configuration files are local to a specific host. Logging must be enabled on the host that the daemon is running. If you have a multi-host cluster, you need to find which host the daemon (sd, ssm, sim, agent) is running, before enabling logging. Alternateively, you can use soamlog that is described in the next section.

    2. Open the sd.log4j.properties file and modify the following line and save.

    log4j.rootLogger=INFO, SD

    to

    log4j.rootLogger=DEBUG, SD

    3. Stop and then restart Symphony DE.

    4. On the host with the SD, go to the /logs directory.

    5. You can view the sd.{hostname}.log file.

    Enable DEBUG logging for the SSM using soamlog

    1. Soamlog is a Symphony DE utility that can dynamically switch on debugging.

    2. To enable DEBUG level logging for the ssm, use the following commands.

    Get your application name using soamview app. It must be either pre-started or actively running, otherwise the ssm won't be started.

    >soamview app
    APPLICATION STATUS SSM HOST SSM PID CONSUMER
    symping4.0 enabled ashanmug-2k3* 3640 /SymTesting/Symp*
    symexec4.0 disabled - - /SymExec/SymExec*

    Set the log level to DEBUG.

    >soamlog ssm_all symping4.0 -l LOG_DEBUG
    Log level setting command was successfully sent to Session Director.

    Set the log level to INFO

    >soamlog ssm_all symping4.0 -l LOG_INFO
    Log level setting command was successfully sent to Session Director.

    3. View the ssm.{hostname}.log file in the /logs directory on the host the ssm is running on.

    4. soamlog works for the sd (sd_all), ssm (ssm_all) and sim (sim_all)

    Note: The soamlog settings are kept in memory only. If the daemon is stopped and then restarted, the logging setting reverts to its default value. Use the log4j.properties method, if you want the log debug settings to be persisted.

  2. #2
    vitali is offline Junior Member
    Join Date
    July 29th, 2008
    Location
    Mississauga
    Posts
    13
    Downloads
    10
    Uploads
    0

    Default Use of log4cxx in service

    What is your suggestions about using log4cxx in service? I would like to use in my service for tracing.

  3. #3
    Ajith's Avatar
    Ajith is offline Symphony DE Moderator
    Join Date
    February 28th, 2008
    Location
    Markham, Ontario
    Posts
    108
    Blog Entries
    2
    Downloads
    10
    Uploads
    0

    Default Logging

    You are free to use log4cxx, just download the latest version and use it. We use log4cxx inside Symphony, but changed the namespace to avoid interactions with different versions.

    We also have a logging sample that implements a simple logging scheme. See the 4.0/samples/CPP/Logging/Service directory in your Symphony installation for an example.

    - Ajith

  4. #4
    vitali is offline Junior Member
    Join Date
    July 29th, 2008
    Location
    Mississauga
    Posts
    13
    Downloads
    10
    Uploads
    0

    Default

    It means I should no worry about interaction. Thank you for answer.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts