Skip to content
Permalink
Browse files
[FIXED JENKINS-10559] log IP address for anonymous user instead of "?"
  • Loading branch information
alanharder committed Aug 3, 2011
1 parent 72639c1 commit 8d1e44b3bce60853dbd47a04b808143194e29c33
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/hudson/plugins/audit_trail/AuditTrailFilter.java
@@ -1,7 +1,7 @@
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Alan Harder
* Copyright (c) 2004-2011, Sun Microsystems, Inc., Alan Harder
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -53,7 +53,8 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
String uri = ((HttpServletRequest)req).getRequestURI();
if (uriPattern != null && uriPattern.matcher(uri).matches()) {
User user = User.current();
String username = user != null ? user.getId() : "?", extra = "";
String username = user != null ? user.getId() : req.getRemoteAddr(),
extra = "";
// For queue items, show what task is in the queue:
if (uri.startsWith("/queue/item/")) try {
extra = " (" + Hudson.getInstance().getQueue().getItem(Integer.parseInt(

0 comments on commit 8d1e44b

Please sign in to comment.