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

Log4php respecting root but not logger

I'm attempting to log to two different log files, one "alert.log" to be monitored, and one "debug.log" for troubleshooting. In the configuration below, the "alert.log" grows with error messages, and the "debug.log" is created as a zero-length file…
phatfingers
  • 9,770
  • 3
  • 30
  • 44
0
votes
1 answer

Log4php wrong time

I'm a new user of log4php and I have a problem with the time. The time logged in the log file is late of 2 hours compared with the real time. My configuration file contains: < layout class="LoggerLayoutPattern"> < param…
0
votes
1 answer

what are cofigure options for log4php to disable logging?

This method Logger::configure($options); of log4php is used to configure logging options. How should $options argument look like to disable log4php completely?
luka
  • 317
  • 4
  • 10
0
votes
1 answer

What's the idiomatic way to do general logging in PHP?

Coming from a Java background, I'm used to logging frameworks like log4j, logback and slf4j. However, when doing PHP programming, I find my self using echo and var_dump/print_r and write logging information to (usually) the web pages I'm working…
NilsH
  • 13,705
  • 4
  • 41
  • 59
0
votes
1 answer

How do I configure log4php with Drupal 7?

Have configured log4php module with Drupal 7 after trying out with many patches available. Module got successfully installed after following this one https://drupal.org/node/1921258 Still no log in .log file. Tested with basic PHP applications to…
0
votes
0 answers

Class 'Logger' not found in LoggerRoot.php when using require_once

I am using log4php here, and keeping get error when using require_once: $path = dirname(__FILE__) . '/../log4php'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); require_once 'Logger.php'; PHP Fatal error: Class 'Logger' not found…
zhihong
  • 1,808
  • 2
  • 24
  • 34
0
votes
0 answers

Pattern not being used

When trying to use LoggerLayoutPattern, the logger uses the Simple Layout for…
abhinav
  • 3,199
  • 2
  • 21
  • 25
0
votes
1 answer

Log4php naming loggers based on namespace and logging to specific files

I'm using log4php and I have basically wrapped it so when any of my classes call Logger they also initalise it with getLogger and name the logger based on the namespace of the calling class e.g. namespace…
TheStoneFox
  • 3,007
  • 3
  • 31
  • 47
0
votes
1 answer

Tracking user activity on php using log4php

I already have a simple audit trail for my system. But my professor wants to add what the user did for the audit trail. I can't even imagine how to do that. I discovered log4php http://logging.apache.org/log4php/index.html I've learned that it…
user1967153
  • 75
  • 1
  • 5
  • 13
0
votes
1 answer

Inter-operable log4php and Chainsaw/remote log viewer

I'm in need of a remote log viewer like chainsaw for log4php. When i use log4j, chainsaw is my first option, where as though log4php is same to log4j, chainsaw is not responding well. For, eg., i gave this…
Kris
  • 8,680
  • 4
  • 39
  • 67
0
votes
1 answer

disable or detect Default Configuration

I have php file which contains class "FooClass" uses in a few projects. I recently add method for logging with log4net like this: private static function log($message,$level=0) { if(!isset(self::$logger)) { …
gam6itko
  • 15,128
  • 2
  • 19
  • 18
0
votes
2 answers

PHPDocx log4php Configurator

I am getting error while executing phpdocx create function. Although its working fine localy. Severity: Notice --> Undefined index: log4php.threshold
Asif
  • 258
  • 1
  • 6
  • 19
0
votes
1 answer

Redirecting php logs (custom application) using Log4php to syslog-ng

I have a custom application running on client which uses php, whose log's are controlled by log4php.properties ( say DEBUG or INFO ) however, in addtion existing logging setup, i would like to send these logs to syslog-ng running server. Below is…
cb24
  • 61
  • 2
  • 6
0
votes
2 answers

Class 'Logger' not found in LoggerRoot.php

I'm trying to install log4php in a very simple site (trying to learn how it works). Apache is installed in /etc/ and vhost is defined as: DocumentRoot "/home/fferri/workspace/site-tutorial/www" ServerName tutorial.localhost php_value…
Killrazor
  • 6,856
  • 15
  • 53
  • 69
0
votes
1 answer

log4php: How to change database name / db host / username dynamically in XML?

I have a case where I might be having multiple DBs and each DB will have it's own log table. Since I'm using DBAppender in a log4php.xml, how do I change dynamically (on rumtime) change the database name and/or db host. Is there any possibility to…
Arfeen
  • 2,553
  • 5
  • 29
  • 48