-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Systemd Logger #10048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Systemd Logger #10048
Conversation
Added a unit test Signed-off-by: Johannes Ernst <jernst@indiecomputing.com>
Changed name of default system (not systemd) logger from ownCloud to Nextcloud, to be consistent Fixed license per #9760 (comment) Pulled upstream updates Signed-off-by: Johannes Ernst <jernst@indiecomputing.com>
Signed-off-by: Johannes Ernst <jernst@indiecomputing.com>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
|
|
||
| public function __construct(IConfig $config) { | ||
| openlog($config->getSystemValue('syslog_tag', 'ownCloud'), LOG_PID | LOG_CONS, LOG_USER); | ||
| openlog($config->getSystemValue('syslog_tag', 'Nextcloud'), LOG_PID | LOG_CONS, LOG_USER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chaning of this tag should be in the release notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add it to the crucial changes document for now.
…n the web server error log Signed-off-by: Morris Jobke <hey@morrisjobke.de>
|
I also tested a bit the error cases and it caused a white page of death. So I tweaked a bit the error handling to not fail super hard if the logger throws an exception itself. So now we have the "black on white - there happened an internal server error" as well as a log to the web servers error log about an unhandled exception containing the hint and the message. 👍 from my side |
|
@MorrisJobke 👍 (i cannot review here) |
|
sure 👍 |
|
The same issue popped up again, just with a different file ( |
|
^ that made things only worse 😩 |
| \OC::$server->getLogger()->logException($ex, array('app' => 'index')); | ||
| \OC::$server->getLogger()->logException($ex2, array('app' => 'index')); | ||
| } catch (Throwable $e) { | ||
| // no way to log it properly - but to avoid a white page of death we try harder and ignore this one here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe fall back to error_loging the exception message so there is at least an error message somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one, because it is logged in the print already. If there happen so many errors, then it is likely to be the same root cause. And logging it twice (both times while creating the logger) doesn't make it more valuable.
| print("More details can be found in the server log.\n"); | ||
|
|
||
| // and then throw it again to log it at least to the web server error log | ||
| throw $e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icewind1991 This one logs it then in the web server error log, but allows to print something before things break apart.
bc0f2f8 to
0dd2621
Compare
|
Next attempt: the db-shm file is now white listed (y no complain about db-wal file?) and the FileLog tests delete the log files it created. UPDATE:
now it does. didn't do it locally (i could reproduce otherwise). |
aaab568 to
40eb104
Compare
|
Nah. hydra. |
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
40eb104 to
83339ae
Compare
|
The image for "nodb-php7.2" was pushed to nextcloudci/php7.2:php7.2-12, which in itself only added the systemd module. But apparently it also updated php-redis, which behaves differently when an Redis connection cannot be established: it fires Exceptions now instead of emitting warnings. The failing test configuration has Redis disabled, but because of this they are not skipped. Further the exception we receive is "Connection refused" which I consider too general to just safely ignore it. For now it reverted the image back to 11 for that configuration and it seems to work again. The drama around the stray files… weird symptom leading to wrong directions. Does not happen anymore. |
|
For the record, in -12 we have php-redis |
|
thanks @jernst :) |
|
No problem. I need this!! |
|
There was a regression: fixed by #10080 |
was #9760 – rebased