Where are the PostgreSQL logs on macOS?

前端 未结 8 1764
慢半拍i
慢半拍i 2020-12-12 15:57

I would like to take a look at the PostgreSQL log files to see what my app writes to them but I can\'t find them.

Any ideas?

相关标签:
8条回答
  • 2020-12-12 16:51

    The plist used to launch your Postgres on boot may also set the logfile:

    $ dir ~/Library/LaunchAgents
    org.postgresql.postgres.plist
    
    $ cat ~/Library/LaunchAgents/org.postgresql.postgres.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      [...]
      <key>StandardErrorPath</key>
      <string>/usr/local/var/postgres/server.log</string>
    </dict>
    </plist>
    

    So in this case, /usr/local/var/postgres/server.log.

    0 讨论(0)
  • 2020-12-12 16:51

    Look in /var/log/pg_log/ folder

    0 讨论(0)
提交回复
热议问题