Errors, logging and performance · Question 9 of 12

The classes in the namespace Vendor\MyExt should write to their own file from level INFO. The configuration is $GLOBALS['TYPO3_CONF_VARS']['LOG']['Vendor']['MyExt']['writerConfiguration'][LogLevel::INFO][FileWriter::class] = ['logFileInfix' => 'myext']. Which statements are true?

2 answers are correct. Medium

Show answer

Answer

  • B The entries end up in a file such as var/log/typo3_myext_<hash>.log
  • D Only this writerConfiguration applies to these classes, the global one with WARNING is not applied in addition

Explanation

The logger name is derived from the class name (Vendor.MyExt.Service.Import), and the LogManager searches from general to specific for the most specific writerConfiguration. As soon as one exists for Vendor.MyExt, it replaces the global one. The FileWriter puts logFileInfix in front of the hash of the default log file, resulting in typo3_myext_<hash>.log. Only the DatabaseWriter writes to the database, and it is not configured here.

Certifications & exams

Which exam comes next?

You can already practise for 19 exams, and 21 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications