View Issue Details

IDProjectCategoryView StatusLast Update
0019642mantisbtadministrationpublic2020-01-20 05:55
Reporterdregad Assigned Todregad  
Status closedResolutionfixed 
Target Version2.21.0Fixed in Version2.21.0 
Summary0019642: If log file is not writable, log_event() fails silently

If the file specified in $g_log_destination is not writeable by the web server process, log_event() fail without any indication to the user.

TagsNo tags attached.


related to 0025734 closeddregad LOGFILE_NOT_WRITABLE error triggered if file does not exist 
related to 0026614 closeddregad SOAP: User Credentials appear in plain text in error log 




2015-04-22 11:38

reporter   ~0050591

I would like to enter the community and I want to work on this issue.




2015-04-22 12:09

developer   ~0050592

Hello Kevin

All contributions are welcome. Please fork our repository on Github [1], and send us a pull request against the master branch with your proposed fix.

Suggested reading:

  • developers guide [2]
  • coding guidelines [3] as well as [4]

If you have any questions, I suggest you register on the developers mailing list [5] and send them that way, or ping us on gitter [6].




2015-04-28 11:04

reporter   ~0050667

I've tried to reproduce the bug and I think I have succeeded.
But I am not sure about the bug,is it about the error message from php or do you want the log_event function to return a message ?




2015-04-29 10:10

developer   ~0050676

Basically log_event() should trigger an error when the specified log file is not writable.



2015-05-06 18:28

reporter   ~0050706

I've found two way to solve this bug.
Basically one of them only show a warning message on the logging screen explaining that mantis can't write on the log file.
Or I can print a warning and prevent user to use mantis if they don't change the file.
which one do you prefer ?

Thank You



2015-05-07 04:46

developer   ~0050707

I'm not sure what you mean exactly by "logging screen", but displaying a warning on the user's screen is the way to go.



2015-05-17 05:02

developer   ~0050770




2019-03-21 13:30

developer   ~0061732

New PR

Related Changesets

MantisBT: master 6d288c64

2019-03-21 12:25:35


Details Diff
Display error when Mantis log file is not writable

Fixes 0019642
Affected Issues
mod - core/constant_inc.php Diff File
mod - core/logging_api.php Diff File
mod - lang/strings_english.txt Diff File

MantisBT: master c8d16e7d

2019-03-21 12:47:25


Details Diff
New error_log_delayed() API function

Encapsulates the logic to enqueue error messages for later display.

Issue 0019642
Affected Issues
mod - core/error_api.php Diff File

MantisBT: master-2.21 1c1ffd3b

2019-05-05 12:34:16


Committer: GitHub Details Diff
log_event() create log file if it does not exist (0001509)

log_event() create log file if it does not exist

This is a regression from issue 0019642. When MantisBT tries to write an
event to a log file that does not already exist, a warning is printed
and the file is not created even if PHP process has write access to the
directory. The event is added to the PHP system log.

Instead of relying on is_writable(), the code now calls error_log() with
errors suppressed, then checks the result of the function call to
determine if the operation was successful or not.

Fixes 0025734
Affected Issues
0019642, 0025734
mod - core/logging_api.php Diff File

Issue History

Date Modified Username Field Change
2015-04-20 19:35 dregad New Issue
2015-04-22 11:38 kevin556 Note Added: 0050591
2015-04-22 12:09 dregad Note Added: 0050592
2015-04-28 11:04 kevin556 Note Added: 0050667
2015-04-29 10:10 dregad Note Added: 0050676
2015-05-06 18:28 kevin556 Note Added: 0050706
2015-05-07 04:46 dregad Note Added: 0050707
2015-05-17 05:02 dregad Note Added: 0050770
2015-05-17 12:56 vboctor Assigned To => community
2015-05-17 12:56 vboctor Status new => assigned
2019-03-21 13:29 dregad Assigned To community => dregad
2019-03-21 13:30 dregad Note Added: 0061732
2019-04-01 16:43 dregad Changeset attached => MantisBT master c8d16e7d
2019-04-01 16:43 dregad Changeset attached => MantisBT master 6d288c64
2019-04-01 16:43 dregad Status assigned => resolved
2019-04-01 16:43 dregad Resolution open => fixed
2019-04-01 16:43 dregad Fixed in Version => 2.21.0
2019-04-01 16:44 dregad Target Version => 2.21.0
2019-04-21 02:53 vboctor Status resolved => closed
2019-05-04 06:31 dregad Issue cloned: 0025734
2019-05-04 06:31 dregad Relationship added related to 0025734
2019-05-05 12:34 dregad Changeset attached => MantisBT master-2.21 1c1ffd3b
2020-01-20 05:55 dregad Relationship added related to 0026614