summaryrefslogtreecommitdiffstats
path: root/lib/private/Log.php
Commit message (Collapse)AuthorAgeFilesLines
* allow apps to specify methods carrying sensitive parametersArthur Schiwon2022-07-281-7/+32
| | | | | | … in order to remove them from logging. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Fix logging data context to fileThomas Citharel2022-05-021-13/+21
| | | | | | | | | | | | | It was only logged when an exception was provided or when using logData (which is not being much used). We make sure the interpolated parameters are not logged. Only tested with file write logger, but shouldn't work differently. Crash reporters always had the context. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* don't error if we can't load the ExceptionSerializer for early exceptionsRobin Appelman2022-03-141-1/+7
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Diagnostics event logging to Nextcloud logJulius Härtl2022-02-281-1/+1
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net> Add config samples Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Interpolate the log message also for logged exceptionsChristoph Wurst2021-11-291-8/+19
| | | | | | | | | | | According to PSR-3 the log message can have placeholders that are replaced from the context object. Our logger implementation did that for all PSR-3 logger methods. The only exception was our custom `logException`. Since PsrLoggerAdapter calls logException when an exception key is present in the context object, log messages were no longer interpolated. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Avoid huge exception argument loggingRoeland Jago Douma2020-12-291-1/+1
| | | | | | | | | | | | | In some cases it might happen that you have an argument that deep down somewhere has an array with a lot of entries (think thousands). Now before we would just happily print them all. Which would fill the log. Now it will just print the first 5. And add a line that there are N more. If you are on debug level we will still print them all. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Replace abandoned log normalizer with our forkChristoph Wurst2020-12-031-2/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-1/+1
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* always require a message paramter for data loggingArthur Schiwon2020-01-281-1/+2
| | | | | | also ensure it plays well with current log reader Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* log Flow activityArthur Schiwon2020-01-281-1/+24
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Update license headersChristoph Wurst2019-12-051-5/+6
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-221-1/+1
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Do not escape slashes for logged exceptionsJulius Härtl2019-10-151-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* catch exceptions that occur during loggingRobin Appelman2019-09-191-24/+31
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Allow crash reporters to catpture any messageChristoph Wurst2019-05-091-4/+15
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add breadcrumb support to crash reportersChristoph Wurst2018-09-051-0/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fetch logcondition earlierRoeland Jago Douma2018-07-301-1/+2
| | | | | | Fixes #9693 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make sure the log doesn't try to read from PUT if it can'tRoeland Jago Douma2018-05-301-1/+9
| | | | | | | | | | | | | | If a PUT request comes in that is not JSON or from encoded. Then we can only read it (exactly) once. If that is the case we must assume no shared secret is set. If we don't then we either are the first to read it, thus causing the real read of the data to fail. Or we are later and then it throws an exception (also failing the request). Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* revert Log's dependency to SystemConfig to work during InstallationArthur Schiwon2018-04-261-7/+6
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* move IFileBased to public namespace, logreader needs itArthur Schiwon2018-04-261-1/+1
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* offer API to create own File log. admin_audit makes use of itArthur Schiwon2018-04-261-9/+10
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* destaticfy Log classesArthur Schiwon2018-04-261-34/+12
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* move log constants to ILoggerArthur Schiwon2018-04-261-12/+12
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Log classnames of arguments in exception traceRobin Appelman2018-04-171-95/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* log previous exceptionRobin Appelman2018-04-111-12/+23
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* adjust tests to new exception log formatRobin Appelman2018-04-111-6/+13
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Log exceptions as nested array instead of encoded jsonRobin Appelman2018-04-101-44/+83
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Loglevel is an intRoeland Jago Douma2018-02-271-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Typehint ThrowableRoeland Jago Douma2018-02-271-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make ILogger strictRoeland Jago Douma2018-02-271-16/+17
| | | | | | | * Make implementations strict * Add scalar typehints Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Pass log level to log reportersMorris Jobke2017-11-271-0/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Pass the exception context to the crash reporterChristoph Wurst2017-11-141-1/+1
| | | | | | | | This should allow better reports as often the app id is passed as context. While this is not used right now, I'd like to have this for NC13 as adding it later will break the interface for existing apps Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add a mechanism to register crach reportersChristoph Wurst2017-11-141-4/+12
| | | | | | | | This adds a crash reporter registry, which is meant for third party apps to hook into the error logging/reporting chain. This way, external tools like Sentry can be used to track and aggregate system crashes. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersMorris Jobke2017-11-061-1/+4
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Added additional methods for removal of sensitive infoJohannes Schlichenmaier2017-10-271-0/+6
| | | | Signed-off-by: Johannes Schlichenmaier <johannes@schlichenmaier.info>
* Improve exception handlingMorris Jobke2017-09-261-0/+3
| | | | | | | | | | If there is an exception in the template handling then a white page is shown. This improves the handling of this and shows text only about the internal error. To test this just setup redis as cache and then disable the php-redis module. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Don't log LDAP password when server is not availableJoas Schilling2017-09-061-3/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Don't log passwords on dav exceptionsJoas Schilling2017-06-291-5/+10
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove unused use statementsMorris Jobke2017-04-221-1/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Add method to $methodsWithSensitiveParametersMorris Jobke2017-04-061-0/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Don't log the password on confirmPassword when LDAP throws an exceptionJoas Schilling2017-02-071-1/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Better fallback for unknown log typesJoas Schilling2017-01-101-9/+10
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add testsJoas Schilling2017-01-091-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Handle log_type "nextcloud" more gracefullyJoas Schilling2017-01-051-5/+22
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Default to empty stringLukas Reschke2016-10-071-1/+1
| | | | | | | | Otherwise `null` is returned which leads to a ton of similar error messages if the log condition setting is enabled.: ``` {"reqId":"3wVBarnDfOV3qkI1bVCU","remoteAddr":"89.98.78.41","app":"PHP","message":"hash_equals(): Expected user_string to be a string, null given at \/var\/www\/html\/lib\/private\/Log.php#275","level":3,"time":"2016-10-07T14:22:15+00:00","method":"PROPFIND","url":"\/remote.php\/webdav\/","user":"icewind"} ```
* Change the minimum log level to fatalJuan Pablo Villafáñez2016-09-261-1/+1
| | | | | | Downstreaming of https://github.com/owncloud/core/pull/26213 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* hide parameters of tryLogin when loggingArthur Schiwon2016-08-221-0/+3
|
* Changed code style and made use of '===' comparison.Thomas Pulzer2016-07-221-1/+4
|
* Changed logtype to file instead of owncloud.Thomas Pulzer2016-07-221-1/+3
| | | | | | | | | | | | | | - Updated the config sample to point to log_type='file' - Renamed the Class for logfile logging to File in namespace 'OC\Log\'. Changed the occurrences of 'OC\Log\Owncloud' to 'OC\Log\File'. - Renamed the Class for log:file command to File in namespace 'OC\Core\Command\Log\File'. Changed registration of the command to use 'OC\Core\Command\Log\File'. - Changed default Syslog tag to Nextcloud - Retained backwards compatibility for configs with 'logtype' => 'owncloud' - Adjusted tests for the new file log. Closes #490.