0

私はVPSサーバー上でDebianを実行しており、開発コードと本番コードの両方とデータベースを同じサーバー上に持っています。

サーバーに、本番ではなく、サーバーの開発部分のエラーのみをログに記録させることは可能ですか?現在、本番側からログに記録されるエラーが非常に多いため、開発エラーに到達するのは困難です。

4

1 に答える 1

3

これは実際にはserverfault.comに属していますが:

必ずすべてのエラーをログに記録する必要があります。

たとえば、サーバーでexample.comとtest.example.comの2つのドメインをホストしている場合は、ログを保存する仮想ホストごとに指定できます。

apacheでは、仮想ホストは次のようになります。

<VirtualHost xxx.xxx.xxx.xxx:80>
    // some configuration stuff
    ServerName     example.com
    // some more configuration stuff
    CustomLog      /var/log/httpd/example.com-access_log combined
    ErrorLog       /var/log/httpd/example.com-error_log
</VirtualHost>

<VirtualHost xxx.xxx.xxx.xxx:80>
    // some configuration stuff
    ServerName     test.example.com
    // some more configuration stuff
    CustomLog      /var/log/httpd/test.example.com-access_log combined
    ErrorLog       /var/log/httpd/test.example.com-error_log
</VirtualHost>

test.example.comしたがって、のログ情報をから 簡単に区別できますexample.com

于 2012-06-25T21:07:33.563 に答える