hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

hhvm.log.level ignored

Open MarkGavalda opened this issue 12 years ago • 9 comments

Trying to focus on Errors only, but when setting hhvm.log.level = Error (or hhvm.log.level = error) it's just ignored. Latest nightly on Ubuntu 14.04. hhvm-nightly (2014.05.14~trusty)

MarkGavalda avatar May 14 '14 09:05 MarkGavalda

This might already be fixed with some in-trunk Ini changes. @ptarjan?

jdelong avatar May 15 '14 16:05 jdelong

Still seems broken:

[fredemmott@devbig076 ~] hhvm -c test.ini test.php

Warning: Foo in /home/fredemmott/test.php on line 3

Fatal error: Foo in /home/fredemmott/test.php on line 4
[fredemmott@devbig076 ~] cat test.log
cat: test.log: No such file or directory
[fredemmott@devbig076 ~] cat test.ini
hhvm.log.level=error
hhvm.log.use_log_file=true
hhvm.log.file=/home/fredemmott/test.log
[fredemmott@devbig076 ~] cat test.php
<?php

trigger_error('Foo', E_USER_WARNING);
trigger_error('Foo', E_USER_ERROR);

fredemmott avatar May 16 '14 18:05 fredemmott

So, sadly hhvm.log.level represents something totally different left over from the HPHPc days. You probably want a error_reporting replacement right?

Well, hhvm.log.runtime_error_reporting_level is close to what you want. Constants are broken in INI files, so if you want only system errors you can do

hhvm.log.runtime_error_reporting_level = 1

or if you want the user errors too like @fredemmott was trying

hhvm.log.runtime_error_reporting_level = 1 | 256

I'm going to go make

error_reporting = 1 | 256

work, so it is a bit less confusing.

Where did you find the reference to hhvm.log.level? It shouldn't be used or recommended.

ptarjan avatar May 19 '14 07:05 ptarjan

And I went to make error_reporting work, and it already does!

error_reporting = 1 | 256

should do what you want.

ptarjan avatar May 19 '14 07:05 ptarjan

Thanks for clearing it up, @ptarjan ! The default php.ini comes with: ; hhvm specific hhvm.log.level = Warning

That's where I got the info from! Cheers

MarkGavalda avatar Jun 03 '14 11:06 MarkGavalda

@ptarjan Unfortunately I could never get this to work. No matter what I set and where HHVM always logs notices and warnings too. :-/

MarkGavalda avatar Jan 26 '15 00:01 MarkGavalda

I also have this issue... my error logs are gigantic sometimes if there's too many warnings and notices. I only need errors. What to do?

rollecode avatar Jan 30 '16 13:01 rollecode

i've to use ramfs for logging to avoid disk burning due to tons of notices due to this issue

ghost avatar Aug 01 '16 00:08 ghost

Actually, could you file a separate issue for this? The base issue from this should already have been solved.

Orvid avatar Aug 01 '16 17:08 Orvid