Questions tagged [log4php]

Apache log4php is a versatile logging framework for PHP.

Apache log4php is a versatile logging framework for PHP.

Features:

  • Configuration through XML, properties or PHP files
  • Various logging destinations, including:
    • Console (stdout, stderr)
    • Files (including daily and rolling files)
    • Email
    • Databases
    • Sockets
    • Syslog
  • Several built-in log message formats, including:
    • HTML
    • XML
    • User defined pattern
  • Nested (NDC) and Mapped (MDC) Diagnostic Contexts.

Official Website: http://logging.apache.org/log4php/

Useful Links:

92 questions
0
votes
1 answer

Php log4php mkdir permission denied

After moving the project from a local machine to a production machine, I get the following error: Warning: mkdir(): Permission denied…
florin
  • 719
  • 12
  • 31
0
votes
1 answer

Write a header to a log with log4php

I have semi-colon separated values logged to a csv file using log4php. I wanted to write a header in first line. How this can be done? Example message id, file name, start time, end time,…
LeMoussel
  • 5,290
  • 12
  • 69
  • 122
0
votes
1 answer

How to change log file name dynamically in log4php?

I am new to log4php and I would like to change the log file name and path dynamically. I do this, but there is nothing in Test.log message. $crawlupLogger =…
LeMoussel
  • 5,290
  • 12
  • 69
  • 122
0
votes
0 answers

Create valid log4php XML files

How can one create valid XML files using log4php? The file is not created with valid XML headers. I am using the append option, so I understand I can append to a proper file, but if I want to start a new file I have to make one each time. There must…
user3822370
  • 641
  • 7
  • 20
0
votes
1 answer

how do I configure log4php to filter by classname?

Is there any way to configure log4php to output logs only for a given class?
0
votes
0 answers

API logging using log4php

I have log4php working via the command line successfully but I am struggling when using it with an PHP API (via Apache). The error I am getting is; PHP Warning: log4php: Configuration failed. Error loading configuration file: failed to load…
0
votes
1 answer

Apache log4php LoggerAppenderDailyFile maxBackupIndex

In Apache's log4php LoggerAppenderDailyFile appender, is it possible to limit the number of backup files kept? Like what is done with the LoggerAppenderRollingFile appender's maxBackupIndex parameter. See:…
Brandon Dudek
  • 849
  • 1
  • 8
  • 18
0
votes
1 answer

Buffering of logs in log4php

Does log4php support buffering of logs before writing to the disk? If so, is it possible to control the buffer size or the time limit after which the logs will be written to disk (similar to the control offered in nginx access_log file)?
Mohan P
  • 389
  • 1
  • 5
  • 11
0
votes
1 answer

Modify/configure log4php LoggerLayoutHtml to insert
tags

Sorry, rather obscure... but there doesn't appear to be a log4php forum. I just want to log a string and for the newlines to be output in the HTML log as
. Trouble is, even if you use PHP's nl2br, it appears the logger reconverts back to the…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
0
votes
1 answer

log4php renderer unable to convert object to string

I am using log4php and within my objects, I would like to log the object variables upon entry and exit of a method (for debug purposes). I came across log4php's renderer functionality and thought it would be a great idea but I am unable to get it to…
ChicagoSky
  • 1,290
  • 3
  • 22
  • 50
0
votes
1 answer

Is it possible to use only the root logger in log4php?

In the log4php documentation they configure only a root logger. (see: http://logging.apache.org/log4php/quickstart.html)
Alex Pineda
  • 2,909
  • 2
  • 14
  • 17
0
votes
0 answers

Structure for singleton logger in zend framework 2 using log4php

I've downloaded the log4php and created a module named logger that will serve as a singleton reference for my skeleton zend 2 framework application. In application.config I registered the module "Logger" and have the following structure for my…
0
votes
0 answers

Multiple loggers

I'd like to create multiple loggers where different areas of my app will log to different files. For example, all the classes associated with getting the users data would log to a user.log, all functionality of making purchases going to a…
mudface
  • 93
  • 1
  • 6
0
votes
1 answer

log4php logger's additivity

In log4php configuration documentation, there is a configuration option called "additivity" which stops the inheritance from root loggers. However, I added to the PHP-format configuration file, root logger is still logging the entry that supposed to…
Raptor
  • 53,206
  • 45
  • 230
  • 366
0
votes
0 answers

How can one force Log4php to reload the config file in a PHP CLI daemon

In a Linux daemon running a PHP CLI that uses Log4php, how can I force log4php to reload the XML config file? Thanks in advance!
Brad Urani
  • 1,429
  • 1
  • 16
  • 29