Page MenuHomePhorge

Cannot use both per_user_logging and kolabdav_user_debug
Closed, ResolvedPublic

Description

When I set both these option I got "PHP Warning: file_put_contents(/var/log/iRony/mark.german@example.org/mark.german@example.org/httpraw): failed to open stream: No such file or directory in /usr/share/roundcubemail/program/lib/Roundcube/rcube.php on line 1242" in error log.

I looks like both cannot be easily used. I propose to get rid of kolabdav_user_debug.

Details

Ticket Type
Task

Event Timeline

And related to this, enabling e.g. imap_debug together with any of above options does not really work as expected, i.e. the whole imap conversation from after login goes where expected, but everything before the user has been authenticated goes to logs/imap. Maybe it would be possible to fix this by setting $_SESSION['username'] before loging into imap.

Diff created. I didn't find a nice way to avoid imap_debug issue described in my comment above. There are two sides of this issue though:

  • user id/name is not set before user is authenticated. That's why some part of logs go to logs/ directory instead of logs/<username>/. I found a workaround, but a little bit hacky. In DAVLogger::_construct() add:
$_SESSION['username'] = $_SERVER['PHP_AUTH_USER'];
$_SESSION['user_id']      = -1;

this however requires to login with canonified username, if you use alias for login and canonified username for logs dir it will not catch up.
Anyway this is not a big issue, as most relevant logs are written on after auth.

  • should logs/imap file (and others) be created at all if per_user_logging=true? I mean that's current behaviour, but changing this would allow as to have all debug options enabled with per_user_logging and get logs only for set up users.

@bruederli what do you think?