ASF Bugzilla – Attachment 25344 Details for
Bug 49180
Add option to disable log rotation in FileHandler.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Disables log rotation in Tomcat's JULI FileHandler
FileHandler.patch (text/plain), 1.69 KB, created by
Pid
on 2010-04-24 13:36:09 UTC
(
hide
)
Description:
Disables log rotation in Tomcat's JULI FileHandler
Filename:
MIME Type:
Creator:
Pid
Created:
2010-04-24 13:36:09 UTC
Size:
1.69 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P tomcat-7.0.x >Index: java/org/apache/juli/FileHandler.java >=================================================================== >--- java/org/apache/juli/FileHandler.java (revision 937651) >+++ java/org/apache/juli/FileHandler.java (working copy) >@@ -95,6 +95,12 @@ > > > /** >+ * Determines whether the logfile is rotatable >+ */ >+ private boolean rotatable = true; >+ >+ >+ /** > * The PrintWriter to which we are currently logging, if any. > */ > private volatile PrintWriter writer = null; >@@ -134,7 +140,7 @@ > > writerLock.readLock().lock(); > // If the date has changed, switch log files >- if (!date.equals(tsDate)) { >+ if (rotatable && !date.equals(tsDate)) { > // Update to writeLock before we switch > writerLock.readLock().unlock(); > writerLock.writeLock().lock(); >@@ -245,6 +251,7 @@ > ClassLoader cl = Thread.currentThread().getContextClassLoader(); > > // Retrieve configuration of logging file name >+ rotatable = Boolean.parseBoolean(getProperty(className + ".rotatable", "true")); > if (directory == null) > directory = getProperty(className + ".directory", "logs"); > if (prefix == null) >@@ -326,7 +333,7 @@ > writerLock.writeLock().lock(); > try { > String pathname = dir.getAbsolutePath() + File.separator + >- prefix + date + suffix; >+ prefix + (rotatable ? date : "") + suffix; > String encoding = getEncoding(); > FileOutputStream fos = new FileOutputStream(pathname, true); > OutputStream os = bufferSize>0?new BufferedOutputStream(fos,bufferSize):fos;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 49180
: 25344 |
26844