[ 
https://issues.apache.org/jira/browse/LOG4PHP-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brian Thibault updated LOG4PHP-208:
-----------------------------------

    Description: 
I'm using my logger in a distributed environment and really need another 
available field for MongoDB, called jobID, so I can tie a queued job to the 
logged event. 

I think it could be handled with something like: 
{code}
public function log( LoggerLevel $level, $message, $throwable = null, $extras = 
array('jobId' => new MongoId('foo123'), 'foo' => 'bar') )
{code}
{code}
{
  _id: ObjectId("51c08aca162d280300000000"),
  jobId: ObjectId("foo123"),
  foo: 'bar', 
  timestamp: ISODate("2013-06-18T16:28:58.017Z"),
  level: "ERROR",
  thread: 3,
  message: "User: xxx has no API credentials.",
  loggerName: "main",
  fileName: "/app/admin/protected/components/xxx.php",
  method: "_setApi",
  lineNumber: 86,
  className: "xxx"
}
{code}


I tried to extend the Logger package to build this in, but I found it rather 
un-extensible. I ended up extending pretty much all the files, which at that 
point, may as well just edit the core files. 

Thanks


  was:
I'm using my logger in a distributed environment and really need another 
available field for MongoDB, called jobID, so I can tie a queued job to the 
logged event. 

I think it could be handled with something like: 

public function log( LoggerLevel $level, $message, $throwable = null, $extras = 
array('jobId' => new MongoId('foo123'), 'foo' => 'bar') )

{
  _id: ObjectId("51c08aca162d280300000000"),
  jobId: ObjectId("foo123"),
  foo: 'bar', 
  timestamp: ISODate("2013-06-18T16:28:58.017Z"),
  level: "ERROR",
  thread: 3,
  message: "User: xxx has no API credentials.",
  loggerName: "main",
  fileName: "/app/admin/protected/components/xxx.php",
  method: "_setApi",
  lineNumber: 86,
  className: "xxx"
}


I tried to extend the Logger package to build this in, but I found it rather 
un-extensible. I ended up extending pretty much all the files, which at that 
point, may as well just edit the core files. 

Thanks


    
> Add ability to pass more information to the MongoDB logger 
> -----------------------------------------------------------
>
>                 Key: LOG4PHP-208
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-208
>             Project: Log4php
>          Issue Type: Improvement
>          Components: Code
>            Reporter: Brian Thibault
>              Labels: mongo
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> I'm using my logger in a distributed environment and really need another 
> available field for MongoDB, called jobID, so I can tie a queued job to the 
> logged event. 
> I think it could be handled with something like: 
> {code}
> public function log( LoggerLevel $level, $message, $throwable = null, $extras 
> = array('jobId' => new MongoId('foo123'), 'foo' => 'bar') )
> {code}
> {code}
> {
>   _id: ObjectId("51c08aca162d280300000000"),
>   jobId: ObjectId("foo123"),
>   foo: 'bar', 
>   timestamp: ISODate("2013-06-18T16:28:58.017Z"),
>   level: "ERROR",
>   thread: 3,
>   message: "User: xxx has no API credentials.",
>   loggerName: "main",
>   fileName: "/app/admin/protected/components/xxx.php",
>   method: "_setApi",
>   lineNumber: 86,
>   className: "xxx"
> }
> {code}
> I tried to extend the Logger package to build this in, but I found it rather 
> un-extensible. I ended up extending pretty much all the files, which at that 
> point, may as well just edit the core files. 
> Thanks

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to