Jump to content
xisto Community
Jonnyabc

Intro To Log4Php How do I get started?

Recommended Posts

I am new to log4php and was hoping someone could help me. I have copied in the source directory (named 'src' if I'm not mistaken) from the zipped folder into my htdocs directory. Aside from that, the only coding I have accomplished is a 'require("/log/Logger.php")' on a new page.

It is very frustrating finding nothing out there as to step-by-step instructions (the best I found thus far is this or this). Even the official Apache landing pages give me no help.

I could understand the process of sending a log to the script, but I can't seem to figure out what is what for configuration. For one, I keep seeing a DoSomething() function mentioned in generally the same spot within scripts, but this does not tell me if this is a real function or simply sudocode.

If I create a custom, hand-written configuration file, where do/should I place it? Do I create a specific config file for each custom log or one big one? Say I name a custom log as cstmLog, how does this look in the code (hierarchy)?

Lastly, it appears as though there are several ways to compile the configuration file (.ini, .xml, or .php), and there are several scripts that appear as though they would do this automatically, but I haven't found that magic ingredient. Additionally, there are several rows within the Logger.php file that COULD be used to configure the initial setup, but I have my reservations as to whether or not this should be changed in that code or something else.


Unfortunately, this is something that I have been assigned to get done today, but I'm liking this less and less...if it were a personal project, I'd be able to spend more time at it, but I don't have that luxury with this. I haven't had the need to study/code asynchronous logging or hierarchical methods/classes in PHP thus far, so a fair majority of this code is foreign to me (such as, what the heck is a '::' for?). Ask me to create a forum from scratch, no problem. Ask me to use log4php, um, yeah...help me please.

Edited by Jonnyabc (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.