Ich suche eine Beschreibung oder Beispiel-Code, wie ich von einer Extension aus ins Error-Log des Forums schreiben kann. (Admin->Wartung->Fehlerprotokoll)
Die API-Doc https://area51.phpbb.com/docs/code/mast ... g/log.html habe ich zwar gefunden, aber ein kleines Beispiel könnte viele "try and error" -Runden vermeiden.
Vielen Dank.
[3.3] Von einer Extension ins error log schreiben
Re: [3.3] Von einer Extension ins error log schreiben
Benutze die Funktion
aus dem von dir verlinkten Artikel:
https://area51.phpbb.com/docs/code/mast ... method_add
Die Funktion selbst findest du in der Datei: ( ab Zeile 219 )
phpBB3/phpbb/log/log.php
Code Beispiele :
https://github.com/DrDeath/phpbb-ext-f1 ... es.yml#L15
https://github.com/DrDeath/phpbb-ext-f1 ... in.php#L91
https://github.com/DrDeath/phpbb-ext-f1 ... n.php#L107
Moderator Log
https://github.com/DrDeath/phpbb-ext-f1 ... n.php#L899
User Log
https://github.com/DrDeath/phpbb-ext-f1 ... .php#L1641
Admin Log:
https://github.com/DrDeath/phpbb-ext-f1 ... e.php#L179
Um in das Fehler Log Einträge hinzuzufügen benutze den $mode '
public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array())
aus dem von dir verlinkten Artikel:
https://area51.phpbb.com/docs/code/mast ... method_add
Die Funktion selbst findest du in der Datei: ( ab Zeile 219 )
phpBB3/phpbb/log/log.php
Code Beispiele :
https://github.com/DrDeath/phpbb-ext-f1 ... es.yml#L15
https://github.com/DrDeath/phpbb-ext-f1 ... in.php#L91
https://github.com/DrDeath/phpbb-ext-f1 ... n.php#L107
Moderator Log
https://github.com/DrDeath/phpbb-ext-f1 ... n.php#L899
User Log
https://github.com/DrDeath/phpbb-ext-f1 ... .php#L1641
Admin Log:
https://github.com/DrDeath/phpbb-ext-f1 ... e.php#L179
Um in das Fehler Log Einträge hinzuzufügen benutze den $mode '
critical
'$phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'DEIN_TEXT_DEINE_SPRACHVARIABLE');
Re: [3.3] Von einer Extension ins error log schreiben
Super. Danke!