Questions tagged [monolog]

Monolog is a logging library for PHP 5.3 used by Symfony2. It is inspired by the Python LogBook library.

514 questions
1
vote
1 answer

monolog custom service access from a service

Please, Is there a quick way to have monolog service available in a an_other_service service without passing the monolog service reference as argument from a controller ? Exactly I've created a custom monolog channel which is written to a specific…
1
vote
1 answer

Monolog stash log formatting

I'm looking to write my log in correct json way to be able to parse it in logstash. Here is my monolog setup in config.yml: monolog: channels: ["event"] handlers: ... eventlog: type: stream path:…
peter
  • 147
  • 2
  • 13
1
vote
1 answer

Monolog logs file for every session

I'm using symfony for a cron run application that runs every day I want to use monolog to write an info report that I can then email, so I'm looking for a way to separate the files by session id. Example: report: type: stream path: …
user3886650
  • 159
  • 10
1
vote
1 answer

why is phpunit throwing PHPUnit_Framework_Exception on monolog messages?

PHPUnit seems to be throwing exceptions on Monolog, logged errors. Is there a way around this? I've tried several methods such as using PHP's set_error_handler function -- but that didn't work for obvious reasons (an error really isn't being…
William
  • 166
  • 4
  • 15
1
vote
1 answer

Monolog composer.json is not working

I got this error trying to install Monolog, I've tried to install it using sudo command, but still it will not work. I'm using Ubuntu 14.04. Loading composer repositories with package information Installing dependencies (including require-dev) Your…
1
vote
1 answer

Using monolog loggly handler in Symfony

I'm trying to use the Monolog Loggly handler in Symfony2 but can't get it to work: # config.yml monolog: handlers: main: type: stream token: my-loggly-token level: info handler: loggly …
greg
  • 6,853
  • 15
  • 58
  • 71
1
vote
3 answers

How to set-up a generic leveraged logging using Monolog?

I am writting a console application with Symfony2 components, and I want to add distinct logging channels for my services, my commands and so on. The problem: to create a new channel requires to create a new instance of Monolog, and I don't really…
Alain Tiemblo
  • 36,099
  • 17
  • 121
  • 153
1
vote
1 answer

Disable logging in Laravel?

Is there any global configuration option to disable all logging? I don't just mean disabling the logging of errors. I mean actually disabling writing to the file when Log:: is called.
Chris Harrison
  • 5,512
  • 3
  • 28
  • 36
1
vote
2 answers

How to disable laravel logs temporarily?

I felt into a log recursion problem and I would like to disable logs only for a single operation. Is there any kind of runtime switch for Laravel logs? Like:
marcio
  • 10,002
  • 11
  • 54
  • 83
1
vote
1 answer

Monolog processors not working with Symfony

I want to use Monolog processors on Symfony, but it looks like monolog doesn't use the processor. Here is my config_dev.yml relevant extract: services: monolog.formatter.user_info: class: Monolog\Formatter\LineFormatter …
jblanche
  • 158
  • 9
1
vote
1 answer

Laravel: custom logging message

I am getting 2014-06-23 02:23:14] log.INFO: General information log [] [] in my log.txt while calling $monolog->info('General information log'); I don't understand the need of [] [] hence I want to get rid of these square brackets from logged…
PHP Ferrari
  • 15,754
  • 27
  • 83
  • 149
1
vote
1 answer

symfony2 monolog command output to console in dev

I'm trying to set up a console command in Symfony2 so that it logs to the console in my dev environment, but to a logfile in prod. so my config_prod.yml has this: monolog: handlers: payment: type: stream path: …
Tom
  • 2,688
  • 3
  • 29
  • 53
1
vote
0 answers

Symfony complex environment configuration

Assume (simplified) I have a stage machine and a live machine. Both should be tested using the prod environment. Unfortunately on our stage machine there is one memcache instance available. On live there are three memcache instances. We have to use…
Stefan
  • 3,382
  • 4
  • 23
  • 27
1
vote
1 answer

How to write custom event log in monolog library?

I am using Laravel to build my web site.I installed monolog library to keep logging. I want to log for click event. how can I do this? Please help.
IshaS
  • 837
  • 1
  • 10
  • 31
1
vote
1 answer

Showing current user in log

I'm trying to create a custom monolog processor to attach the current user to an error mailer. When declaring a service like so: monolog.processor.mail: class: MyVendor\Monolog\Processor\MailProcessor arguments: -…
Flip
  • 4,778
  • 1
  • 34
  • 48