aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Log.php
Commit message (Collapse)AuthorAgeFilesLines
* fix(log): Fix log level handlingbackport/50455/stable31Joas Schilling2025-01-271-0/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(logger): Prevent infinite recursion with log.condition => matchesbugfix/noid/prevent-infitnite-loopJoas Schilling2025-01-031-0/+12
| | | | | | | | | | When we need to check the log condition for a user matches, there is a risk that something on the way checks the log level and would result in an infinite loop. So we simply check if it's a nested call and use the default warning level in that case. Signed-off-by: Joas Schilling <coding@schilljs.com>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-1/+1
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* refactor(Log): Use new in initializer instead of constructor bodyFerdinand Thiessen2024-08-171-5/+1
| | | | | | | PHP 8.1 allows us to now move the `new` into the initializer, this makes the code a bit nicer (and 3 lines shorter). Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* feat(log): Allow to combine log.conditions to only log (app&user)Joas Schilling2024-07-301-24/+68
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-31/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix(Logger): Warn on invalid `loglevel` configuration optionFerdinand Thiessen2024-03-171-1/+7
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix: getLogLevel return typeskjnldsv2024-03-171-1/+2
| | | | Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
* fix(core): remove deprecated codeMaxence Lange2024-03-121-6/+2
| | | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* fix(core): minor syntax updateMaxence Lange2024-03-121-45/+20
| | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* add hasListeners()Maxence Lange2024-02-141-11/+10
| | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* exit log() early if no crashreporter registeredMaxence Lange2024-02-141-13/+10
| | | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-2/+2
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* fix(log): Log exception class when message is emptyJoas Schilling2023-11-131-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add optional to add backtrace to log itemsRobin Appelman2023-07-101-0/+6
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix user log.condition featureCôme Chilliet2023-06-261-8/+12
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* emit an event when a message is loggedRobin Appelman2023-06-131-1/+22
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_privateRobin Appelman2023-06-011-3/+3
|\ | | | | Refactors "strpos" calls in lib/private to improve code readability.
| * Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-3/+3
| | | | | | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* | Log to error_log in fatal caseRobin Windey2023-05-231-0/+1
|/ | | | Signed-off-by: Robin Windey <ro.windey@gmail.com>
* composer run cs:fixCôme Chilliet2023-01-201-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* chore: Add typings to Log propertiesJulius Härtl2023-01-161-16/+6
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* perf(logging): Return early when log level does not match before serializing ↵Julius Härtl2023-01-161-1/+5
| | | | | | an exception Signed-off-by: Julius Härtl <jus@bitgrid.net>
* 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>