Exclude Component from error_log?

Dominik L Posted in Technical Support 2 years ago

Hello!

How can I exclude a component from error_log?

It produces useless error messages

Replies
German Dominik L Replied 2 years ago

It’s already solved since one week

German Michael Zülsdorff Replied 2 years ago

How can error messages be useless?!?
Error messages are always issued by PHP for a good reason,
if something in the code is wrong. Therefore they should not be suppressed but reported to the developer.

Let's have a look at this simple example code to calculate the birthdate:

$current_year = 2023;
$date_of_birth = 2000;
print "Age: " . $current_year - $date_of_birth;

Everything's fine for now and the output will be Age: 23


Same code, but the developer made a typo

$current_year = 2023;
$date_of_birth = 2000;
print "Age: " . $current_yeah - $date_of_birth;

This time, the output will be Age: -2000
and your log shows

Undefined variable $current_yeah in /home/micha/Develop/ex.php on line 3

Actually, PHP would continue here, and if the output wasn't so obviously strange nobody would ever notice the issue without the error log. Thus please provide your logs instead of ignoring or suppressing them.

Polish Brandon Libran Replied 2 years ago

You can use a level filter to exclude error messages from your error log. Here is an example of how to do it in Logback Spring Boot:

xml <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>ERROR</level> <onMatch>DENY</onMatch> <onMismatch>ACCEPT</onMismatch> </filter>

This will exclude all error messages from your error log. You can replace ERROR with any other log level you want to exclude.

I hope this helps!

Indonesian Arsalan Shah Replied 2 years ago

See my answer 1 hour ago.

German Dominik L Replied 2 years ago

yes, component produces error when someone is not verifies, which makes no sense

Indonesian Arsalan Shah Replied 2 years ago

You said it is because of component you are getting error log

German Dominik L Replied 2 years ago

Which component upgrade?

Indonesian Arsalan Shah Replied 2 years ago

There is no help it is not possible what you are asking. Wait for the component upgrade.

German Dominik L Replied 2 years ago

Any help?

German Dominik L Replied 2 years ago

I don't want the complete log to be deactivated, but I get an error from the VerifyUser component which is filling the error log and makes finding problems very difficult