You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Thomas Hommers <th...@ebalu.com> on 2012/06/20 10:49:47 UTC

CouchDB log to Syslog

Hi,

I am looking for a way to harmonize different logs from different systems (Mailserver, Webserver, DBs, ...).
Does somebody know of a way how to let couchDB log to syslog?

Suggestion about another approach to keep track of different logs are welcome too. As I just started with the project it would still be possible to switch the tools (for a good reason).

Thanks in advance!
Thomas

Re: CouchDB log to Syslog

Posted by CGS <cg...@gmail.com>.
The best practice for logging an applications under Linux is to do it under
/var/log/<application_name>/ and CouchDB follows it (you just need to set
PREFIX option to / at configuration time). Combining CouchDB log with
webserver log with... in syslog may be a bad idea because of the following
reasons:
1. write access;
2. enormous size of the log;
3. difficulty in searching for specific errors.
These are but the main reasons I can see now. I am sure that if one sits on
it he/she can find more.

But if you still think of that idea, find in default.ini (or local.ini for
that matter) the log part:

[log]
file = /var/log/couchdb/couch.log
level = info
include_sasl = true

and you can redefine it to

file = /var/log/syslog

Force CouchDB to reload the initialization files or restart it and you have
CouchDB log thrown into your syslog.

CGS




On Wed, Jun 20, 2012 at 11:17 AM, Peter Lemenkov <le...@gmail.com> wrote:

> 2012/6/20 Alexander Shorin <kx...@gmail.com>:
> > Hi Thomas,
> >
> > AFAIK, such feature currently available only by self source patching:
> > https://issues.apache.org/jira/browse/COUCHDB-706
> >
> > but I suppose any feedback and improvements would be welcomed(:
>
> Log everything to stdout/stderr and redirect both of them to the
> syslog by using systemd's Journald - I'm currently considering this
> approach for Fedora package. I'm sure this won't work for everyone but
> you asked for alternatives so here it is.
>
>
> --
> With best regards, Peter Lemenkov.
>

Re: CouchDB log to Syslog

Posted by Peter Lemenkov <le...@gmail.com>.
2012/6/20 Alexander Shorin <kx...@gmail.com>:
> Hi Thomas,
>
> AFAIK, such feature currently available only by self source patching:
> https://issues.apache.org/jira/browse/COUCHDB-706
>
> but I suppose any feedback and improvements would be welcomed(:

Log everything to stdout/stderr and redirect both of them to the
syslog by using systemd's Journald - I'm currently considering this
approach for Fedora package. I'm sure this won't work for everyone but
you asked for alternatives so here it is.


-- 
With best regards, Peter Lemenkov.

Re: CouchDB log to Syslog

Posted by Alexander Shorin <kx...@gmail.com>.
Hi Thomas,

AFAIK, such feature currently available only by self source patching:
https://issues.apache.org/jira/browse/COUCHDB-706

but I suppose any feedback and improvements would be welcomed(:

--
,,,^..^,,,


On Wed, Jun 20, 2012 at 12:49 PM, Thomas Hommers
<th...@ebalu.com> wrote:
> Hi,
>
> I am looking for a way to harmonize different logs from different systems (Mailserver, Webserver, DBs, ...).
> Does somebody know of a way how to let couchDB log to syslog?
>
> Suggestion about another approach to keep track of different logs are welcome too. As I just started with the project it would still be possible to switch the tools (for a good reason).
>
> Thanks in advance!
> Thomas

Re: CouchDB log to Syslog

Posted by Robert Newson <rn...@apache.org>.
sorry, there isn't, though './rebar compile' answers your first question. Adding it to couchdb is a little tricky as it doesn't use rebar. You can look at the autoconf stuff that builds the several projects under src/, though. It's basically just another one of those. Then you need to tweak the log macros in couch_db.hrl to use twig instead.

B.


On 20 Jun 2012, at 13:35, Thomas Hommers wrote:

> Hi,
> 
> are there any resources how to use / compile TWIG ?
> 
> I saw it's written in Erlang and there is a file called "rebar". Do I need to use this to compile it? Furthermore, how to link it to couchdb then?
> 
> Thanks and regards
> Thomas
> ________________________________________
> From: Thomas Hommers [thomas.hommers@ebalu.com]
> Sent: Wednesday, June 20, 2012 6:21 PM
> To: user@couchdb.apache.org
> Subject: RE: CouchDB log to Syslog
> 
> Thanks! that's exactly what I have been looking for :)
> ________________________________________
> From: Robert Newson [rnewson@apache.org]
> Sent: Wednesday, June 20, 2012 6:04 PM
> To: user@couchdb.apache.org
> Subject: Re: CouchDB log to Syslog
> 
> Hi,
> 
> You could look at our twig project (https://github.com/cloudant/twig). We use this to make CouchDB send its log information to a remote syslog server, which is what I presume you meant rather that directing data to /var/log/syslog. Further, you should *not* tell couchdb to write to /var/log/syslog as it will not work properly with concurrent writers or with the normal log rotation scheme for that file.
> 
> B.
> 
> 
> On 20 Jun 2012, at 09:49, Thomas Hommers wrote:
> 
>> Hi,
>> 
>> I am looking for a way to harmonize different logs from different systems (Mailserver, Webserver, DBs, ...).
>> Does somebody know of a way how to let couchDB log to syslog?
>> 
>> Suggestion about another approach to keep track of different logs are welcome too. As I just started with the project it would still be possible to switch the tools (for a good reason).
>> 
>> Thanks in advance!
>> Thomas
> 


RE: CouchDB log to Syslog

Posted by Thomas Hommers <th...@ebalu.com>.
Hi,

are there any resources how to use / compile TWIG ?

I saw it's written in Erlang and there is a file called "rebar". Do I need to use this to compile it? Furthermore, how to link it to couchdb then?

Thanks and regards
Thomas
________________________________________
From: Thomas Hommers [thomas.hommers@ebalu.com]
Sent: Wednesday, June 20, 2012 6:21 PM
To: user@couchdb.apache.org
Subject: RE: CouchDB log to Syslog

Thanks! that's exactly what I have been looking for :)
________________________________________
From: Robert Newson [rnewson@apache.org]
Sent: Wednesday, June 20, 2012 6:04 PM
To: user@couchdb.apache.org
Subject: Re: CouchDB log to Syslog

Hi,

You could look at our twig project (https://github.com/cloudant/twig). We use this to make CouchDB send its log information to a remote syslog server, which is what I presume you meant rather that directing data to /var/log/syslog. Further, you should *not* tell couchdb to write to /var/log/syslog as it will not work properly with concurrent writers or with the normal log rotation scheme for that file.

B.


On 20 Jun 2012, at 09:49, Thomas Hommers wrote:

> Hi,
>
> I am looking for a way to harmonize different logs from different systems (Mailserver, Webserver, DBs, ...).
> Does somebody know of a way how to let couchDB log to syslog?
>
> Suggestion about another approach to keep track of different logs are welcome too. As I just started with the project it would still be possible to switch the tools (for a good reason).
>
> Thanks in advance!
> Thomas


RE: CouchDB log to Syslog

Posted by Thomas Hommers <th...@ebalu.com>.
Thanks! that's exactly what I have been looking for :)
________________________________________
From: Robert Newson [rnewson@apache.org]
Sent: Wednesday, June 20, 2012 6:04 PM
To: user@couchdb.apache.org
Subject: Re: CouchDB log to Syslog

Hi,

You could look at our twig project (https://github.com/cloudant/twig). We use this to make CouchDB send its log information to a remote syslog server, which is what I presume you meant rather that directing data to /var/log/syslog. Further, you should *not* tell couchdb to write to /var/log/syslog as it will not work properly with concurrent writers or with the normal log rotation scheme for that file.

B.


On 20 Jun 2012, at 09:49, Thomas Hommers wrote:

> Hi,
>
> I am looking for a way to harmonize different logs from different systems (Mailserver, Webserver, DBs, ...).
> Does somebody know of a way how to let couchDB log to syslog?
>
> Suggestion about another approach to keep track of different logs are welcome too. As I just started with the project it would still be possible to switch the tools (for a good reason).
>
> Thanks in advance!
> Thomas


Re: CouchDB log to Syslog

Posted by Robert Newson <rn...@apache.org>.
Hi,

You could look at our twig project (https://github.com/cloudant/twig). We use this to make CouchDB send its log information to a remote syslog server, which is what I presume you meant rather that directing data to /var/log/syslog. Further, you should *not* tell couchdb to write to /var/log/syslog as it will not work properly with concurrent writers or with the normal log rotation scheme for that file.

B.


On 20 Jun 2012, at 09:49, Thomas Hommers wrote:

> Hi,
> 
> I am looking for a way to harmonize different logs from different systems (Mailserver, Webserver, DBs, ...).
> Does somebody know of a way how to let couchDB log to syslog?
> 
> Suggestion about another approach to keep track of different logs are welcome too. As I just started with the project it would still be possible to switch the tools (for a good reason).
> 
> Thanks in advance!
> Thomas