Get help from other users here.
Moderators: Developer , Contributor
Dominus
Posts: 10 Joined: 11 Aug 2020, 05:36
Post
by Dominus » 11 Aug 2020, 05:54
I am in the process of trying to make a plugin for Mantis, but I want to have logging built in to it. However, I'm missing how exactly one would add an entry to the log with it denoted as a plugin.
Code: Select all
log_event(LOG_FILTERING,$this->name);
works perfectly. But change it to LOG_PLUGIN and it spits out
Code: Select all
SYSTEM NOTICE: 'Use of undefined constant LOG_PLUGIN - assumed 'LOG_PLUGIN''
. Any ideas?
cas
Posts: 1586 Joined: 11 Mar 2006, 16:08
Contact:
Post
by cas » 11 Aug 2020, 08:03
This is described in the admin guide as of page 59, did you verify already?
cas
Posts: 1586 Joined: 11 Mar 2006, 16:08
Contact:
Post
by cas » 11 Aug 2020, 09:12
LOG_ALL should also take care of the plugin logging so something else is happening.
log_event(LOG_PLUGIN, 'problem with this'.$name); should work.
Which version are you using?
Dominus
Posts: 10 Joined: 11 Aug 2020, 05:36
Post
by Dominus » 11 Aug 2020, 13:56
Mantis 2.5.1, schema 209. Log_event works if i use LOG_FILTERING. If I use LOG_PLUGIN, it says undefined constant.
Mantis 2.25.1
PHP 7.4.19
cas
Posts: 1586 Joined: 11 Mar 2006, 16:08
Contact:
Post
by cas » 11 Aug 2020, 14:07
check core/constants_inc.php if it is defined in there.
If not add it or even better upgrade your Mantis to latest & greatest version.
Dominus
Posts: 10 Joined: 11 Aug 2020, 05:36
Post
by Dominus » 13 Aug 2020, 16:03
That was it! I was confused due to being on 2.5.1 and the latest version being 2.24. It works as intended in the latest version.
Mantis 2.25.1
PHP 7.4.19