log daemon

How does a log daemon work?
If I'm upto write on, how should I design it?

for example a syslog daemon, how should I make my daemon so that it gets things that hapends in the system?

Or does every program have to call the daemon to log?

please no answers about reading code, I'w tryed and could'nt get a thing.

regards, Esaia