##// END OF EJS Templates
more work on improving info logging
marcink -
r2025:7e979933 beta
parent child Browse files
Show More
@@ -89,4 +89,4 b' BACKENDS = {'
89 89 CELERY_ON = False
90 90
91 91 # link to config for pylons
92 CONFIG = None
92 CONFIG = {}
@@ -173,7 +173,7 b' def authenticate(username, password):'
173 173 if user is not None and not user.ldap_dn:
174 174 if user.active:
175 175 if user.username == 'default' and user.active:
176 log.info('user %s authenticated correctly as anonymous user',
176 log.info('user %s authenticated correctly as anonymous user' %
177 177 username)
178 178 return True
179 179
@@ -182,7 +182,7 b' def authenticate(username, password):'
182 182 log.info('user %s authenticated correctly' % username)
183 183 return True
184 184 else:
185 log.warning('user %s is disabled' % username)
185 log.warning('user %s tried auth but is disabled' % username)
186 186
187 187 else:
188 188 log.debug('Regular authentication failed')
@@ -434,13 +434,17 b' class LoginRequired(object):'
434 434 api_access_ok = True
435 435 else:
436 436 log.debug("API KEY token not valid")
437
438 log.debug('Checking if %s is authenticated @ %s' % (user.username, cls))
437 loc = "%s:%s" % (cls.__class__.__name__, func.__name__)
438 log.debug('Checking if %s is authenticated @ %s' % (user.username, loc))
439 439 if user.is_authenticated or api_access_ok:
440 log.debug('user %s is authenticated' % user.username)
440 log.info('user %s is authenticated and granted access to %s' % (
441 user.username, loc)
442 )
441 443 return func(*fargs, **fkwargs)
442 444 else:
443 log.warn('user %s NOT authenticated' % user.username)
445 log.warn('user %s NOT authenticated on func: %s' % (
446 user, loc)
447 )
444 448 p = url.current()
445 449
446 450 log.debug('redirecting to login page with %s' % p)
@@ -502,7 +506,7 b' class PermsDecorator(object):'
502 506 return func(*fargs, **fkwargs)
503 507
504 508 else:
505 log.warning('Permission denied for %s %s' % (cls, self.user))
509 log.debug('Permission denied for %s %s' % (cls, self.user))
506 510 anonymous = self.user.username == 'default'
507 511
508 512 if anonymous:
@@ -649,7 +653,7 b' class PermsFunction(object):'
649 653 return True
650 654
651 655 else:
652 log.warning('Permission denied for %s @ %s', self.granted_for,
656 log.debug('Permission denied for %s @ %s', self.granted_for,
653 657 check_Location or 'unspecified location')
654 658 return False
655 659
@@ -147,9 +147,12 b' class BaseController(WSGIController):'
147 147
148 148 session['rhodecode_user'] = self.rhodecode_user.get_cookie_store()
149 149 session.save()
150 log.info('User: %s accessed %s' % (auth_user,
151 environ.get('PATH_INFO')))
150 152 return WSGIController.__call__(self, environ, start_response)
151 153 finally:
152 log.debug('Request time: %.3fs' % (time.time() - start))
154 log.info('Request to %s time: %.3fs' % (environ.get('PATH_INFO'),
155 time.time() - start))
153 156 meta.Session.remove()
154 157
155 158
@@ -256,7 +256,7 b' class ValidAuth(formencode.validators.Fa'
256 256 error_dict=self.e_dict_disable
257 257 )
258 258 else:
259 log.warning('user %s not authenticated' % username)
259 log.warning('user %s failed to authenticate' % username)
260 260 raise formencode.Invalid(
261 261 self.message('invalid_password',
262 262 state=State_obj), value, state,
General Comments 0
You need to be logged in to leave comments. Login now