Configuring Logging for the LiveUpdate Administrator 2.x PostgreSQL Database
search cancel

Configuring Logging for the LiveUpdate Administrator 2.x PostgreSQL Database

book

Article ID: 177643

calendar_today

Updated On:

Products

Endpoint Protection

Issue/Introduction

In order to troubleshoot a suspected issue, how can the logs of the LUA PostgreSQL service be viewed? Information about events seems to be missing.

Symptoms
After installing LiveUpdate Administrator 2.x (LUA 2.x) on a server, the Windows Application Event Log will contain entries similar to:

 

  • Type: Information
    Date: 17/04/2009
    Time: 14:12:39
    Event: 0
    Source: PostgreSQL
    Category: None
    User: N/A
    Computer: SERVERNAME
    Description:
    The description for Event ID ( 0 ) in Source ( PostgreSQL ) could not be found. It contains the following insertion string(s): .
    2009-04-17 14:12:39LOG: database system was shut down at 2009-04-17 14:12:13

    Type: Error
    Date: 17/04/2009
    Time: 14:12:13
    Event: 0
    Source: PostgreSQL
    Category: None
    User: N/A
    Computer: SERVERNAME
    Description:
    The description for Event ID ( 0 ) in Source ( PostgreSQL ) could not be found. It contains the following insertion string(s): .
    FATAL: terminating connection due to administrator command


 

Cause

This is normal behavior. PostgreSQL is an open source object-relational database management system (RDBMS) that has been engineered to operate on many different platforms and operating systems. It has not been designed to record its logs to the Windows Event Logs.

Resolution

By default, logging is disabled. Logging can be enabled to help troubleshoot an issue, though there will be an impact on the server's resources. To enable and configure the level of database logging, alter the postgresql.conf file. The default location in LUA 2.x is in C:\Program Files\Symantec\LiveUpdate Administrator\pgsql\data.

Open this file in a text editor and scroll down to the ERROR REPORTING AND LOGGING section.

Uncomment (remove the # sign) from the following lines:
 

  • # - Where to Log -

    log_destination = 'stderr'
    redirect_stderr = on or logging_collector = on (PostgreSQL 8.3 or later)
    log_directory = 'pg_log'
    log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
    log_rotation_size = 10MB



  •  
  •  

Choose the logging level by selecting the desired value.

Important Note: The following examples show the maximum debug levels. A server should not be left running indefinitely with debug logging enabled. Do not configure debug5 logging when LUA 2.x is performing a purge operation. Always disable or decrease the logging level after troubleshooting is complete.


  • # - When to Log -

    client_min_messages = debug5 # Values, in order of decreasing detail:
    # debug5
    # debug4
    # debug3
    # debug2
    # debug1
    # log
    # notice
    # warning
    # error

    log_min_messages = debug5 # Values, in order of decreasing detail:
    # debug5
    # debug4
    # debug3
    # debug2
    # debug1
    # info
    # notice
    # warning
    # error
    # log
    # fatal
    # panic

    log_error_verbosity = verbose # terse, default, or verbose messages

    log_min_error_statement = debug5 # Values in order of increasing severity:
    # debug5
    # debug4
    # debug3
    # debug2
    # debug1
    # info
    # notice
    # warning
    # error
    # fatal
    # panic (effectively off)

    # - What to Log -

    log_connections = off
    log_disconnections = off
    log_duration = on
    log_line_prefix = '%t %u %d %h %p %i %l %x '
    log_hostname = on



After changes are made to postgresql.conf, the LUA PostgreSQL service must be restarted. Detailed steps on how to stop and start LUA 2.x services via the command line can be found in the Technical Information section, below.

Log files will be found in C:\Program Files\Symantec\LiveUpdate Administrator\pgsql\data\pg_log and have names similar to postgresql-2009-04-21_095211.log.



Technical Information
1) Open a command prompt to stop the "LUA Apache Tomcat" service. (Be sure to use the " " marks as the service name contains a space.)

Command:
net stop "LUA Apache Tomcat"

Output:
The LUA Apache Tomcat service is stopping.
The LUA Apache Tomcat service was stopped successfully.

2) Stop the "LUA PostgreSQL" service.
Command:
net stop "LUA PostgreSQL"

Output:
The LUA PostgreSQL service is stopping.
The LUA PostgreSQL service was stopped successfully.

3) Now restart the "LUA PostgreSQL" service to load the new configuration file.
Command:
net start "LUA PostgreSQL"

Output:
The LUA PostgreSQL service is starting.
The LUA PostgreSQL service was started successfully.

4) Then start the "LUA Apache Tomcat" service.
Command:
net start "LUA Apache Tomcat"

Output:
The LUA Apache Tomcat service is starting.
The LUA Apache Tomcat service was started successfully.