On 5 Apr, Andre John Cruz wrote:
> hello everyone,
>
> i'd like to make a program that logs some output to a text
> file. i have a few questions here:
>
> 1) do i need to implement a locking mechanism? the
> program is web-accessible and many users may be accessing
> it simultaneously. i don't want the log file to get
> corrupted.
>
Yes, of course. Or you can make a daemon program that uses SysVIPC
(or POSIX.1b message queues? are they already supported in Linux?) to
communicate with client processes, queueing each request that would
write to the log file.
> 2) how do i implement syslogging to a different server?
> this is my alternative if i don't like #1. 8)
>
This is similar to the daemon program solution above, except that then
you'd have to develop a simple custom protocol for you to communicate
across the network, and IMO this is not worth the effort. You might as
well use System V IPC to communicate with a local daemon then.
--
Rafael R. Sevilla <[EMAIL PROTECTED]> +63(2) 8177746 ext. 8311
Programmer, InterdotNet Philippines +63(917) 4458925
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]