caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Logging
@ 2010-12-21  9:51 Gregory Bellier
  2010-12-21 10:29 ` Logging Sylvain Le Gall
  0 siblings, 1 reply; 7+ messages in thread
From: Gregory Bellier @ 2010-12-21  9:51 UTC (permalink / raw)
  To: caml-list

Hello.

Until now, whenever I needed to log something, I used my own function
to log. From now on, I face new problems and I would like to use
syslog to get rid of my logging functions and use the proper unix
ones. However, from what I've seen, syslog logs in messages, user,...
but I can't log in a specific file like "my_project.log" unless I hack
in /etc/syslog.cnf (I don't recall the exact path).

How do you do in your projects ? I tried the following package:
libsyslog-ocaml-dev on Debian.

Thanks in advance for any inputs.

Gregory.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Logging
  2010-12-21  9:51 Logging Gregory Bellier
@ 2010-12-21 10:29 ` Sylvain Le Gall
  2010-12-21 11:16   ` [Caml-list] Logging Gregory Bellier
  0 siblings, 1 reply; 7+ messages in thread
From: Sylvain Le Gall @ 2010-12-21 10:29 UTC (permalink / raw)
  To: caml-list

On 21-12-2010, Gregory Bellier <gregory.bellier@gmail.com> wrote:
> Hello.
>
> Until now, whenever I needed to log something, I used my own function
> to log. From now on, I face new problems and I would like to use
> syslog to get rid of my logging functions and use the proper unix
> ones. However, from what I've seen, syslog logs in messages, user,...
> but I can't log in a specific file like "my_project.log" unless I hack
> in /etc/syslog.cnf (I don't recall the exact path).
>
> How do you do in your projects ? I tried the following package:
> libsyslog-ocaml-dev on Debian.
>
> Thanks in advance for any inputs.

There is also Lwt_log.
http://ocsigen.org/lwt/doc/api/Lwt_log.html

Regards,
Sylvain Le Gall


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Re: Logging
  2010-12-21 10:29 ` Logging Sylvain Le Gall
@ 2010-12-21 11:16   ` Gregory Bellier
  2010-12-21 11:21     ` Török Edwin
  2010-12-21 14:33     ` Michael Ekstrand
  0 siblings, 2 replies; 7+ messages in thread
From: Gregory Bellier @ 2010-12-21 11:16 UTC (permalink / raw)
  To: caml-list

2010/12/21 Sylvain Le Gall <sylvain@le-gall.net>:
>
> There is also Lwt_log.
> http://ocsigen.org/lwt/doc/api/Lwt_log.html

To be more verbose, I have two processes with two different effective
uid and I would like them to be able to log in the very same file and
not in /var/log/user.log but /var/log/my_project.log. That's why it's
convenient to call a daemon like syslog which handles the permissions
itself.

It seems that Lwt_log provides functions to call the syslog daemon to
log (which the other module also does) or logs itself. In which case,
I'd have the permissions problem because the log file would have the
identity of the running process which created it. Please correct me if
I'm wrong about Lwt_log.

How does Apache proceed ? You can specify where to log in the config
file and set it to /var/log/apache.log and it works while the process
runs with www-data identity.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Re: Logging
  2010-12-21 11:16   ` [Caml-list] Logging Gregory Bellier
@ 2010-12-21 11:21     ` Török Edwin
  2010-12-21 11:47       ` Gabriel Kerneis
  2010-12-21 14:33     ` Michael Ekstrand
  1 sibling, 1 reply; 7+ messages in thread
From: Török Edwin @ 2010-12-21 11:21 UTC (permalink / raw)
  To: caml-list

On 2010-12-21 13:16, Gregory Bellier wrote:
> 2010/12/21 Sylvain Le Gall <sylvain@le-gall.net>:
>>
>> There is also Lwt_log.
>> http://ocsigen.org/lwt/doc/api/Lwt_log.html
> 
> To be more verbose, I have two processes with two different effective
> uid

If both processes start out as root then you can open the logfile before
dropping privileges.

Best regards,
--Edwin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Re: Logging
  2010-12-21 11:21     ` Török Edwin
@ 2010-12-21 11:47       ` Gabriel Kerneis
  0 siblings, 0 replies; 7+ messages in thread
From: Gabriel Kerneis @ 2010-12-21 11:47 UTC (permalink / raw)
  To: Török Edwin; +Cc: caml-list

On Tue, Dec 21, 2010 at 01:21:44PM +0200, Török Edwin wrote:
> On 2010-12-21 13:16, Gregory Bellier wrote:
> > 2010/12/21 Sylvain Le Gall <sylvain@le-gall.net>:
> >>
> >> There is also Lwt_log.
> >> http://ocsigen.org/lwt/doc/api/Lwt_log.html
> > 
> > To be more verbose, I have two processes with two different effective
> > uid
> 
> If both processes start out as root then you can open the logfile before
> dropping privileges.

But you must take care of concurrent writes (which is the reason why a
daemon is still a good idea).

Best,
-- 
Gabriel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Re: Logging
  2010-12-21 11:16   ` [Caml-list] Logging Gregory Bellier
  2010-12-21 11:21     ` Török Edwin
@ 2010-12-21 14:33     ` Michael Ekstrand
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Ekstrand @ 2010-12-21 14:33 UTC (permalink / raw)
  To: caml-list

On 12/21/2010 05:16 AM, Gregory Bellier wrote:
> 2010/12/21 Sylvain Le Gall <sylvain@le-gall.net>:
>> There is also Lwt_log.
>> http://ocsigen.org/lwt/doc/api/Lwt_log.html
> To be more verbose, I have two processes with two different effective
> uid and I would like them to be able to log in the very same file and
> not in /var/log/user.log but /var/log/my_project.log. That's why it's
> convenient to call a daemon like syslog which handles the permissions
> itself.
>
> It seems that Lwt_log provides functions to call the syslog daemon to
> log (which the other module also does) or logs itself. In which case,
> I'd have the permissions problem because the log file would have the
> identity of the running process which created it. Please correct me if
> I'm wrong about Lwt_log.
>
> How does Apache proceed ? You can specify where to log in the config
> file and set it to /var/log/apache.log and it works while the process
> runs with www-data identity.

Apache is probably handling the concurrent writes itself.

If you want to use syslog, you will need to use appropriate syslog ident
and facility and configure your syslog daemon to filter those log
messages to a separate file.  It won't do that automatically (and
doesn't let you log to arbitrary files).

Otherwise, I think you'd need to write your own log daemon.

- Michael


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Logging
@ 2006-07-20  9:20 Tiago Antão
  0 siblings, 0 replies; 7+ messages in thread
From: Tiago Antão @ 2006-07-20  9:20 UTC (permalink / raw)
  To: caml-list

Hi!

Are there any best practices/libraries regarding logging in CAML? My
main use for it will be debugging (I know there are debugging
facilities in CAML, but I am very used to using log as a debug tool -
think Log4J for instance)...

Thanks a lot,
Tiago


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-21 14:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-21  9:51 Logging Gregory Bellier
2010-12-21 10:29 ` Logging Sylvain Le Gall
2010-12-21 11:16   ` [Caml-list] Logging Gregory Bellier
2010-12-21 11:21     ` Török Edwin
2010-12-21 11:47       ` Gabriel Kerneis
2010-12-21 14:33     ` Michael Ekstrand
  -- strict thread matches above, loose matches on Subject: below --
2006-07-20  9:20 Logging Tiago Antão

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).