Bulkmarcimport has the -l option, which allows to write to a logfile. It does work, however, its behavior is not what we expect from a logfile. Indeed, bulkmarcimport erases the logfile each time it is executed. The expected behavior imho is to append the logs to the given file. Test plan: 1) use bulkmarcimport several times with the same logfile given with -l. 2) the logfile is erased every time. -> KO Apply the patch, then: 1) use bulkmarcimport several times with the same logfile given with -l. 2) the logs are correctly appended to the logfile. -> OK
Created attachment 25666 [details] [review] proposed patch
Some concerns have been raised on #koha whether new content for a log file should erase previous content or add to it. In my opinion, it should add, to prevent data loss. Managing growing files should be a sysop concern (by using logrotate, for instance).
Created attachment 25961 [details] [review] Bug 11850: Fix bulkmarcimport -l option to append to the logfile Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
From a QA standpoint, if this is controversial, maybe there should be a flag to choose between append vs overwrite for file logging.
I think this can't go in as it is. On #koha an optional flag was discussed: http://irc.koha-community.org/koha/2014-02-26#i_1471750 Setting to "In Discussion". I am tending to make this new behaviour depending on a command line option.
Created attachment 26022 [details] [review] proposed patch
The new proposed patch adds a -append option to add to the logfile.
Created attachment 26313 [details] [review] Bug 11850: Adds a -append option to add data to the logfile Signed-off-by: Magnus Enger <digitalutvikling@gmail.com> Keeps current behaviour as default. The -append option is described in the POD and works as expected.
Created attachment 26314 [details] [review] Bug 11850: [SIGNED-OFF] Adds a -append option to add data to the logfile Signed-off-by: Magnus Enger <digitalutvikling@gmail.com> Keeps current behaviour as default. The -append option is described in the POD and works as expected.
Created attachment 26846 [details] [review] [PASSED QA] Bug 11850: [SIGNED-OFF] Adds a -append option to add data to the logfile Signed-off-by: Magnus Enger <digitalutvikling@gmail.com> Keeps current behaviour as default. The -append option is described in the POD and works as expected. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works as described. Adding a date/time to the output might be good, to make it easier to find the entry you were looking for.
Pushed to master. Thanks, Matthias!
Pushed to 3.14.x, will be in 3.14.08