sabriallani / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
0 stars 0 forks source link

Logging persistence writing rows to the wrong log file #384

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up logging for two item groups, to two different log files

What is the expected output? What do you see instead?

Expect to see the events from the two item groups get logged to two separate 
log files.

However after some time/event (unreproducible) the events for both item groups 
begin logging to the same file.

What version of the product are you using? On what operating system?

1.3.0 snapshot, Ubuntu 12.04

Please provide any additional information below.

Original issue reported on code.google.com by ben.jone...@gmail.com on 21 Jul 2013 at 8:48

GoogleCodeExporter commented 9 years ago
Have been able to reproduce this using the attached config files. Run up 
openHAB and navigate to the classic UI. Turn on TestA1, then turn on TestB1, 
then turn off TestA1 and finally turn off TestB1.

You should see the initial ON events in each log file, but then the off events 
for both switches appear in the B log. 

Original comment by ben.jone...@gmail.com on 24 Jul 2013 at 10:13

Attachments:

GoogleCodeExporter commented 9 years ago
Ok - have pushed a change to my clone which I think should resolve this issue. 
There was a single encoder being used for all logging appenders. However as 
each appender is initialised each one calls .start() which opens the output 
file stream and initialised the encoder with this stream. Therefore the last 
appender loaded becomes the output stream for all previous appenders!

My fix was to create a new encoder for each appender. Please review and merge 
with core if you think it is ok.

Original comment by ben.jone...@gmail.com on 24 Jul 2013 at 11:28

GoogleCodeExporter commented 9 years ago
Hi Ben, thanks for investigating this and for the fix.

Original comment by teichsta on 25 Jul 2013 at 7:33

GoogleCodeExporter commented 9 years ago
Merged to default (see 
http://code.google.com/p/openhab/source/detail?r=5761df62eea2c0a35695cfab2eaa16a
13ad51b43)!

Thanks Ben, for this contribution!

Original comment by teichsta on 25 Jul 2013 at 10:59