Commit Graph

124 Commits (master)

Author SHA1 Message Date
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 week ago
Marcel Klehr 4a3b9b826e refactor: identifier is now customId/custom_id
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
3 weeks ago
Ferdinand Thiessen f06bf0413d
fix(PsrLoggerAdapter): Adjust code to comply with v2 of Psr\Log (allow \Stringable as message)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2 months ago
Git'Fellow d753d04760
Move away from deprecated utf_encode() on PHP 8.2+
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
4 months ago
Côme Chilliet c0ce272e9c chore: Migrate away from OC::$server->getLogger
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
4 months ago
Josh Richards 7a212b1f38 Fix log rotation notification level (warning->info)
Fixes #42537 

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
5 months ago
Faraz Samapoor 9fa9975bc9 Refactors lib/private/Log.
Mainly using PHP8's constructor property promotion.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
11 months ago
Robin Appelman d9fa7b1e28
emit an event when a message is logged
Signed-off-by: Robin Appelman <robin@icewind.nl>
12 months ago
Faraz Samapoor e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
1 year ago
Côme Chilliet 426c0341ff
Use typed version of IConfig::getSystemValue as much as possible
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Max 95a674e238
fix: treat text app session parameters as sensitive values
* `PublicSessionController create` receives a share token.
* The others receive the parameters for a text session:
  `document_id`, `session_id`, `session_token`.
  Even though these are relatively short lived
  they could be used to retrieve content from the document when leaked.

Signed-off-by: Max <max@nextcloud.com>
1 year ago
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Julius Härtl 7daa20d309
fix(ExceptionSerializer): encode arguments before filtering the trace
This will avoid running into a Nesting level too deep error as the
encodeArg calls will limit potential recursive calls on the arguments to
a nesting level of 5

Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 year ago
Christoph Wurst 58a0740794
fix(logging): Fix array to string conversion in errorlog writer
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 year ago
Christoph Wurst 94cebfea7c
chore(logging): Fix branding of errorlog log messages
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2 years ago
Christoph Wurst 4c8ec6dc89
Log all deprecations with debug level
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2 years ago
Christoph Wurst 052dcdebe8
Refactor the ErrorHandler into a dynamic class
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2 years ago
Carl Schwan b888c61463
Merge pull request #33047 from nextcloud/fix/ijob-logger-deprecated
Deprecated ILogger from IJob
2 years ago
Carl Schwan 48d9c4d2b0
Port existing server code to new interface
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Arthur Schiwon 2a6f46e689
allow apps to specify methods carrying sensitive parameters
… in order to remove them from logging.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2 years ago
blizzz cf5452e633
Merge pull request #32242 from nextcloud/fix-logging-data-array
Fix logging data context to file
2 years ago
Arthur Schiwon 8b2b5946e6
make placeholder a const for reuse
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2 years ago
Arthur Schiwon 891c10d09d
fix overwriting original vars when logging
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2 years ago
Thomas Citharel 1e7d924c61
Fix logging data context to file
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>
2 years ago
Joas Schilling 4c41abd816
Allow to get custom loggers for syslog, errorlog and systemdlog too
Signed-off-by: Joas Schilling <coding@schilljs.com>
2 years ago
Côme Chilliet 3a1b3745eb
Fix DateTime constructor calls with null
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
3 years ago
Julius Härtl b235a854d3
Always list the class of an object first
Signed-off-by: Julius Härtl <jus@bitgrid.net>
3 years ago
Julius Härtl 950de74d1d
Set a maximum level of encoding nested arguments of exception traces
This will make sure that nested objects or arrays do not cause exceeding
the maximum nesting level of functions when parsing arguments of an
exception trace

Signed-off-by: Julius Härtl <jus@bitgrid.net>
3 years ago
Lukas Reschke b3ddc09895 Sanitize more functions from the encryption app
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
3 years ago
Daniel Kesselberg 74fa8f3f84
Mask password for Redis and RedisCluster on connection failure
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
3 years ago
Chih-Hsuan Yen 16c4991db6
Correctly skip suppressed errors in PHP 8.0
Applies the suggested transformation mentioned in
https://www.php.net/manual/en/migration80.incompatible.php,

> The @ operator will no longer silence fatal errors (E_ERROR,
> E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR,
> E_PARSE). Error handlers that expect error_reporting to be 0 when
> @ is used, should be adjusted to use a mask check instead

The new code still works on PHP 7, as error_reporting() already
returns 0 when diagnostics are suppressed.

This fixes https://github.com/nextcloud/server/issues/25807 in PHP 8.0.
For PHP 7.x, https://github.com/nextcloud/server/pull/22243 suppresses
the E_NOTICE message from the second session_start() call with the error
suppression operator @, and thus those E_NOTICE messages are still
logged in PHP 8.0.

See also https://github.com/nextcloud/server/issues/25806

Signed-off-by: Chih-Hsuan Yen <yan12125@gmail.com>
3 years ago
Gary Kim b78f3a57d1
Migrate HintException to OCP
Signed-off-by: Gary Kim <gary@garykim.dev>
3 years ago
Pytal 9ed379da22
Merge pull request #27635 from nextcloud/fix/datetime-constants
Fix usage of DateTime constants
3 years ago
Christoph Wurst 770881d5d6
Move DateTime::ATOM to DateTimeInterface::ATOM
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
blizzz ee7a484284
Merge pull request #26346 from J0WI/clean-auth-regex
Cleaner removePassword regex
3 years ago
Julius Härtl e536b7bbcc
Move exception logging to separate field
Signed-off-by: Julius Härtl <jus@bitgrid.net>
3 years ago
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
Joas Schilling 21ed3419f3
Log deprecation only as debug
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Joas Schilling 8d9e5e0b91
Respect the error level when logging
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
J0WI 5f468c0248 Cleaner removePassword regex
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
3 years ago
Christoph Wurst d45692ee96
Migrate custom loggers to PSR
This will help phase out the deprecated ILogger interface.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Joas Schilling 847aa08ebd
Don't log keys on checkSignature
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Morris Jobke 59ae722087
Fix warning in PHP 8 about optional parameter before mandatory one
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Roeland Jago Douma 179de95f81
Avoid huge exception argument logging
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>
3 years ago
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Vincent Petry 9b3361ce87
Don't log params of imagecreatefromstring
To prevent flooding the log with actual image data.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
4 years ago
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Julius Härtl b0699d4126
Generate exception to log on php errors
Signed-off-by: Julius Härtl <jus@bitgrid.net>
4 years ago
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst ab303dddcd
Make the PSR-3 adapter exception-aware
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago