• <cite id="1tsqt"><noscript id="1tsqt"></noscript></cite>

    <rp id="1tsqt"></rp>
    1. <cite id="1tsqt"><span id="1tsqt"><var id="1tsqt"></var></span></cite>
        <ruby id="1tsqt"><meter id="1tsqt"></meter></ruby>

          <rp id="1tsqt"><meter id="1tsqt"></meter></rp>

        1. <b id="1tsqt"><tbody id="1tsqt"></tbody></b>
          <b id="1tsqt"><tbody id="1tsqt"><del id="1tsqt"></del></tbody></b>
          <tt id="1tsqt"><span id="1tsqt"></span></tt>

            <rp id="1tsqt"><menuitem id="1tsqt"><option id="1tsqt"></option></menuitem></rp>

            Support Logging setup

            PostgreSQL Logs

            PostgreSQL Logs

            You can send PostgreSQL logs to Loggly over syslog. Your syslog daemon such as rsyslog will receive these events and then forward them to Loggly. The advantage of Rsyslog is that it can send TCP events without blocking your application, can optionally encrypt the data, and even queue data to add robustness to network failure.

            PostgreSQL Logging Setup

            1. Configure Syslog Daemon

            If you haven’t already, run our automatic Configure-Syslog script below to setup rsyslog. Alternatively, you can Manually Configure Rsyslog or Syslog-ng.

            curl -O http://www.shengxia9.com/install/configure-linux.sh
            sudo bash configure-linux.sh -a SUBDOMAIN -u USERNAME
            

            Replace:

            • SUBDOMAIN: your account subdomain that you created when you signed up for Loggly
            • USERNAME: your Loggly username

            2. Configure Syslog Daemon for UDP Input

            Open rsyslog’s configuration file

            sudo vim /etc/rsyslog.conf
            

            Uncomment these lines to accept UDP messages on the default port 514.

            $ModLoad imudp
            $UDPServerRun 514
            
            PostgreSQL Logging

            Restart the rsyslog service so the changes take effect

            sudo service rsyslog restart
            

            3. Configure PostgreSQL to send logs to Syslog

            Open postgresql.conf file to send PostgreSQL logs to syslog.

            sudo vim /etc/postgresql/9.3/main/postgresql.conf
            

            Update the following configuration

            log_destination = 'syslog'
            

            Restart PostgreSQL

            /etc/init.d/postgresql restart
            

            4. Verify Events

            Search Loggly for events with the appName as postgres or using tags. If if doesn’t work, see the troubleshooting section below.

            syslog.appName:postgres or using the tags you have used.
            
            Postgres Logs Example

            Advanced PostgreSQL Logging Options

            Troubleshooting PostgreSQL Logs

            • Wait a few minutes in case indexing needs to catch up.
            • Check if you have restarted rsyslog service
            • Run “sudo tcpdump -i lo -A udp and port 514″ to verify UDP events are being sent to localhost
            • Search or post your own PostgreSQL logs questions, or other questions around Amazon RDS, database log files, or an instance running in the community forum.
            Thanks for the feedback! We'll use it to improve our support documentation.


            在线看黄wwwabc300