Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
0d3819bb
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0d3819bb
编写于
3月 11, 2014
作者:
O
Olivier Lamy
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1155 from msrb/logging
Switch to java.util.logging on few places
上级
a4c4ed5f
86ad8222
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
24 deletion
+14
-24
core/src/main/java/jenkins/security/ExceptionTranslationFilter.java
...ain/java/jenkins/security/ExceptionTranslationFilter.java
+10
-20
core/src/test/java/hudson/util/io/ZipArchiverTest.java
core/src/test/java/hudson/util/io/ZipArchiverTest.java
+4
-4
未找到文件。
core/src/main/java/jenkins/security/ExceptionTranslationFilter.java
浏览文件 @
0d3819bb
...
...
@@ -28,8 +28,6 @@ import org.acegisecurity.ui.AuthenticationEntryPoint;
import
org.acegisecurity.ui.savedrequest.SavedRequest
;
import
org.acegisecurity.util.PortResolver
;
import
org.acegisecurity.util.PortResolverImpl
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.util.Assert
;
...
...
@@ -42,6 +40,8 @@ import javax.servlet.ServletResponse;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
/**
* Handles any <code>AccessDeniedException</code> and <code>AuthenticationException</code> thrown within the
...
...
@@ -85,7 +85,7 @@ public class ExceptionTranslationFilter implements Filter, InitializingBean {
//~ Static fields/initializers =====================================================================================
private
static
final
Log
logger
=
LogFactory
.
getLog
(
ExceptionTranslationFilter
.
class
);
private
static
final
Log
ger
LOGGER
=
Logger
.
getLogger
(
ExceptionTranslationFilter
.
class
.
getName
()
);
//~ Instance fields ================================================================================================
...
...
@@ -116,9 +116,7 @@ public class ExceptionTranslationFilter implements Filter, InitializingBean {
try
{
chain
.
doFilter
(
request
,
response
);
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Chain processed normally"
);
}
LOGGER
.
finer
(
"Chain processed normally"
);
}
catch
(
AuthenticationException
ex
)
{
handleException
(
request
,
response
,
chain
,
ex
);
...
...
@@ -155,27 +153,21 @@ public class ExceptionTranslationFilter implements Filter, InitializingBean {
private
void
handleException
(
ServletRequest
request
,
ServletResponse
response
,
FilterChain
chain
,
AcegiSecurityException
exception
)
throws
IOException
,
ServletException
{
if
(
exception
instanceof
AuthenticationException
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Authentication exception occurred; redirecting to authentication entry point"
,
exception
);
}
LOGGER
.
log
(
Level
.
FINER
,
"Authentication exception occurred; redirecting to authentication entry point"
,
exception
);
sendStartAuthentication
(
request
,
response
,
chain
,
(
AuthenticationException
)
exception
);
}
else
if
(
exception
instanceof
AccessDeniedException
)
{
if
(
authenticationTrustResolver
.
isAnonymous
(
SecurityContextHolder
.
getContext
().
getAuthentication
()))
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Access is denied (user is anonymous); redirecting to authentication entry point"
,
exception
);
}
LOGGER
.
log
(
Level
.
FINER
,
"Access is denied (user is anonymous); redirecting to authentication entry point"
,
exception
);
sendStartAuthentication
(
request
,
response
,
chain
,
new
InsufficientAuthenticationException
(
"Full authentication is required to access this resource"
,
exception
));
}
else
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Access is denied (user is not anonymous); delegating to AccessDeniedHandler"
,
exception
);
}
LOGGER
.
log
(
Level
.
FINER
,
"Access is denied (user is not anonymous); delegating to AccessDeniedHandler"
,
exception
);
accessDeniedHandler
.
handle
(
request
,
response
,
(
AccessDeniedException
)
exception
);
}
...
...
@@ -205,9 +197,7 @@ public class ExceptionTranslationFilter implements Filter, InitializingBean {
SavedRequest
savedRequest
=
new
SavedRequest
(
httpRequest
,
portResolver
);
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Authentication entry point being called; SavedRequest added to Session: "
+
savedRequest
);
}
LOGGER
.
finer
(
"Authentication entry point being called; SavedRequest added to Session: "
+
savedRequest
);
if
(
createSessionAllowed
)
{
// Store the HTTP request itself. Used by AbstractProcessingFilter
...
...
core/src/test/java/hudson/util/io/ZipArchiverTest.java
浏览文件 @
0d3819bb
...
...
@@ -9,14 +9,14 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.util.Enumeration
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.zip.ZipFile
;
import
java.util.zip.ZipEntry
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.Log
;
public
class
ZipArchiverTest
extends
TestCase
{
private
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
ZipArchiverTest
.
class
.
getName
());
private
File
tmpDir
;
...
...
@@ -103,7 +103,7 @@ public class ZipArchiverTest extends TestCase {
* @param cause the root cause of the failure
*/
private
final
void
fail
(
final
String
msg
,
final
Throwable
cause
)
{
logger
.
error
(
msg
,
cause
);
LOGGER
.
log
(
Level
.
SEVERE
,
msg
,
cause
);
fail
(
msg
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录