summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ding2012-09-04 04:36:09 (EDT)
committer Heng Li2012-09-04 04:36:09 (EDT)
commit50f8058a800f60d619118d2ecd300797d155c178 (patch)
tree87819877dcc35e0e6faf648c4f65f6ab4523ca90
parent271a13af6b3a90d3bf37cc45b18abedcfdad4900 (diff)
downloadorg.eclipse.birt-50f8058a800f60d619118d2ecd300797d155c178.zip
org.eclipse.birt-50f8058a800f60d619118d2ecd300797d155c178.tar.gz
org.eclipse.birt-50f8058a800f60d619118d2ecd300797d155c178.tar.bz2
- Summary: Same information is logged multiple times (T52890)v201209041636
- Bugzilla Bug(s) Resolved: - Description: - Resolution: Log handler will not be added into handler list if it already existed.
-rw-r--r--chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/internal/log/JavaUtilLoggerImpl.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/internal/log/JavaUtilLoggerImpl.java b/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/internal/log/JavaUtilLoggerImpl.java
index 43148aa..f7cec42 100644
--- a/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/internal/log/JavaUtilLoggerImpl.java
+++ b/chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/internal/log/JavaUtilLoggerImpl.java
@@ -42,6 +42,29 @@ public class JavaUtilLoggerImpl implements ILogger
private static StreamHandler fileHandler = null;
private static String stateDir = null;
+
+ private void addLogHandler( )
+ {
+ if ( fileHandler == null )
+ {
+ return;
+ }
+
+ /* if file handler already existed, don't add it */
+ boolean handlerExist = false;
+ for ( java.util.logging.Handler hd : this.logger.getHandlers( ) )
+ {
+ if ( hd.equals( fileHandler ) )
+ {
+ handlerExist = true;
+ break;
+ }
+ }
+ if ( !handlerExist )
+ {
+ this.logger.addHandler( fileHandler );
+ }
+ }
public static void setStateDir( String sStateDir )
{
@@ -63,7 +86,7 @@ public class JavaUtilLoggerImpl implements ILogger
{
javaLevel = fileHandler.getLevel( );
}
- this.logger.addHandler( fileHandler );
+ addLogHandler( );
this.logger.setUseParentHandlers( false );
}