Django虚拟环境,Postgres的日志在哪里保存?

时间:2013-08-04 13:50:49

标签: django postgresql

我有一个在虚拟环境中运行的Django项目(在MAC OS中),我可以在哪里访问postgres日志? 在提出这个问题之前,我已经查看了以下帖子,但我找不到他们建议的地方的日志 * http://www.postgresql.org/docs/9.0/static/runtime-config-logging.html * How to check status of PostgreSQL server Mac OS X * http://www.postgresqlformac.com/server/error_startup_fails_after_i.html * Where are the PostgreSQL logs on Mac OS X?

1 个答案:

答案 0 :(得分:2)

  1. 您可以使用以下命令find

    sudo find / -name pg_log
    

    输出:

    /Library/PostgreSQL/9.2/data/pg_log
    
  2. 如果上述尝试失败,请尝试在plist中找到日志位置

    我的plist位于/Library/LaunchDaemons/,另一个可能的位置是/Library/LaunchAgents/

    检查com.edb.launchd.postgresql-9.2.plist是否包含以下部分:

    <dict>
      ......
      <key>StandardErrorPath</key>
      <string>/usr/local/var/postgres/server.log</string>
    </dict>
    

    在上述情况下,日志位于/usr/local/var/postgres/server.log