Hi Luigi, The first thing that comes to mind is that this may be caused by a log4j feature called additivity. (Documented here: http://logging.apache.org/log4j/2.x/manual/configuration.html#Additivity )
Basically, if your configuration is such that multiple loggers receive a log event, then each logger will add an identical log file entry unless Additivity is switched off. Can you check if this is the case? Best regards, Remko Sent from my iPhone > On 2014/02/19, at 19:12, Luigi Alice <[email protected]> wrote: > > Hello, > > sometimes I have the same log entries multiple times in the log files. > > ... > [08:55:25.406|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|4|DBStatementImpl.executeQuery()] # Abgesetzter SQL-Befehl: [se= > lect * from Z_DUMMY] > [08:55:25.406|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|4|DBStatementImpl.executeQuery()] # Abgesetzter SQL-Befehl: [se= > lect * from Z_DUMMY] > [08:55:25.406|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|4|DBStatementImpl.executeQuery()] # Abgesetzter SQL-Befehl abge= > schlossen. Execution-time: 0 ms > [08:55:25.406|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|4|DBStatementImpl.executeQuery()] # Abgesetzter SQL-Befehl abge= > schlossen. Execution-time: 0 ms > [08:55:25.407|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|4|SelectCommand.executeCommand()] # Select-Kommando: [selMA.sel= > Blub.selBlub]; Anzahl Datens=E4tze: [1]; Execution-time: [0 ms (sum); 0 ms = > (self)]; > [08:55:25.407|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|4|SelectCommand.executeCommand()] # Select-Kommando: [selMA.sel= > Blub.selBlub]; Anzahl Datens=E4tze: [1]; Execution-time: [0 ms (sum); 0 ms = > (self)]; > [08:55:25.407|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|4|SelectCommand.executeCommand()] # Select-Kommando: [selMA.sel= > Blub]; Anzahl Datens=E4tze: [1]; Execution-time: [2 ms (sum); 0 ms (self)]; > [08:55:25.407|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|4|SelectCommand.executeCommand()] # Select-Kommando: [selMA.sel= > Blub]; Anzahl Datens=E4tze: [1]; Execution-time: [2 ms (sum); 0 ms (self)]; > [08:55:25.407|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|3|CommandSequence.fireSubCommandEvent()] # Logging deaktiviert = > ab: selMA.selAtts > [08:55:25.407|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|3|CommandSequence.fireSubCommandEvent()] # Logging deaktiviert = > ab: selMA.selAtts > [08:55:25.409|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|3|CommandSequence.fireSubCommandEvent()] # Logging wieder aktiv= > iert nach: selMA.selAtts > [08:55:25.409|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|3|CommandSequence.fireSubCommandEvent()] # Logging wieder aktiv= > iert nach: selMA.selAtts > [08:55:25.409|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|3|CommandSequence.executeCommand()] # F=FChre Kommandosequenz a= > us: 'selMA.selBlub' > [08:55:25.409|0:0:0:0:0:0:0:1|DC4CFAAC6E824F77BA23D01CB2F0D38A||la.test/dyn= > _table||251|3|CommandSequence.executeCommand()] # F=FChre Kommandosequenz a= > us: 'selMA.selBlub' > ... > > > > I suppose it has something to do with initializing the configuration, but I= > don't' know. > > private void startConfig(String config) > { > synchronized(LogRecorder.class) // parallele Initialisierung ka= > nn zu Deadlock f=FChren > { > try { > > MDC.put("log.dir", this.logDir); // sonst: java.io.File= > NotFoundException: ${ctx:log.dir}\persis.log > final ConfigurationFactory.ConfigurationSource source = > =3D new ConfigurationFactory.ConfigurationSource(new ByteArrayInputStream(c= > onfig.getBytes("UTF-8"))); > final LoggerContext ctx =3D Configurator.initialize(nul= > l, source); > > this.currentConfig =3D config; > > // XMLConfiguration cfg =3D new XMLConfiguration(sc); > // Logger l =3D (Logger) LogManager.getLogger(LogManager= > .ROOT_LOGGER_NAME); > // l.getContext().start(cfg); > } catch (UnsupportedEncodingException ex) { > throw new RuntimeException(ex); > } > } > } > > > Does anyone know this problem or have an idea? > > > Regards > > Mr. L. Alice > Software developer >
