File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 3838
3939use Exception ;
4040use Nextcloud \LogNormalizer \Normalizer ;
41- use OC \AppFramework \Bootstrap \Coordinator ;
4241use OCP \EventDispatcher \IEventDispatcher ;
42+ use OCP \ILogger ;
43+ use OCP \IUserSession ;
4344use OCP \Log \BeforeMessageLoggedEvent ;
4445use OCP \Log \IDataLogger ;
45- use Throwable ;
46- use function array_merge ;
47- use OC \Log \ExceptionSerializer ;
48- use OCP \ILogger ;
4946use OCP \Log \IFileBased ;
5047use OCP \Log \IWriter ;
5148use OCP \Support \CrashReport \IRegistry ;
49+ use OC \AppFramework \Bootstrap \Coordinator ;
50+ use OC \Log \ExceptionSerializer ;
51+ use Throwable ;
52+ use function array_merge ;
5253use function strtr ;
5354
5455/**
@@ -274,10 +275,13 @@ public function getLogLevel($context) {
274275
275276 // check for user
276277 if (isset ($ logCondition ['users ' ])) {
277- $ user = \OC :: $ server -> getUserSession ( )->getUser ();
278+ $ user = \OCP \Server:: get (IUserSession::class )->getUser ();
278279
279- // if the user matches set the log condition to satisfied
280- if ($ user !== null && in_array ($ user ->getUID (), $ logCondition ['users ' ], true )) {
280+ if ($ user === null ) {
281+ // User is not known for this request yet
282+ $ this ->logConditionSatisfied = null ;
283+ } elseif (in_array ($ user ->getUID (), $ logCondition ['users ' ], true )) {
284+ // if the user matches set the log condition to satisfied
281285 $ this ->logConditionSatisfied = true ;
282286 }
283287 }
You can’t perform that action at this time.
0 commit comments