Tinylog writing 2GB of nonsense under Windows, under Linux it behaves has expected. What could be causing this?

105 Views Asked by At

I've recently added logging support using Tinylog to a Java application I'm working on. I'm developing under Linux (Kubuntu latest) and deploying to a Windows server. The application is built using a Gradle task which sets up a "fat jar" so I don't have to worry about dependencies when deploying. The application's role is to access a REST API, check the data for completeness and then load the gathered data into a data warehouse using JDBC.

Tinylog has been configured to write to a file two subdirectories above the executable jar archive (IE ../../foo.log), and under Linux on my development machine it behaves exactly as expected. New entries in the log are appended to the file and it does exactly what a log file is expected to do. This happens both when I run the program from my IDE and run the standalone jar from the shell. However, when I deploy my jar to the Windows server and run it from PowerShell it behaves in a very strange manner. Whenever anything (however small) is appended to the log file, the file immediately grows to ~2GB in size and is apparently full of nothing. I don't know nearly enough about Windows to diagnose this alone.

I've used od on Linux to see what's actually being written to my log file, this is the result:

0000000 032461 032472 035071 033465 030456 032062 044440 043116
0000020 035117 051440 060564 072162 062145 066040 063557 062547
0000040 005162 032461 032472 035071 033465 031056 032460 044440
0000060 043116 035117 046040 060557 062544 020144 052110 050124
0000100 044440 005117 032461 032472 035071 033465 031056 033460
0000120 044440 043116 035117 051040 067165 064556 063556 064440
0000140 020156 067516 042040 072141 061141 071541 020145 067515
0000160 062544 030412 035066 030060 030072 027062 030063 020061
0000200 047111 047506 020072 067507 020164 067145 070144 064557
0000220 072156 020163 067546 020162 033466 020062 061541 062543
0000240 071563 070040 064557 072156 005163 000000 000000 000000
0000260 000000 000000 000000 000000 000000 000000 000000 000000
*
17777777760 000000 000000 000000 000000 000000 000000 000000 030400
20000000000 035066 030460 032472 027060 033060 020064 047111 047506
20000000020 020072 072123 071141 062564 020144 067554 063547 071145
20000000040 005015 033061 030072 035061 030065 034456 034060 044440
20000000060 043116 035117 046040 060557 062544 020144 052110 050124
20000000100 044440 006517 030412 035066 030460 032472 027065 032462
20000000120 020062 047111 047506 020072 067514 062141 062145 042040
20000000140 072141 061141 071541 020145 047511 005015 033061 030072
20000000160 035062 031060 034456 034463 044440 043116 035117 043440
20000000200 072157 062440 062156 067560 067151 071564 063040 071157
20000000220 033040 031467 060440 061543 071545 020163 067560 067151
20000000240 071564 005015
20000000244

The ASCII dump is:

0000000   1   5   :   5   9   :   5   7   .   1   2   4       I   N   F
0000020   O   :       S   t   a   r   t   e   d       l   o   g   g   e
0000040   r  \n   1   5   :   5   9   :   5   7   .   2   0   5       I
0000060   N   F   O   :       L   o   a   d   e   d       H   T   T   P
0000100       I   O  \n   1   5   :   5   9   :   5   7   .   2   0   7
0000120       I   N   F   O   :       R   u   n   n   i   n   g       i
0000140   n       N   o       D   a   t   a   b   a   s   e       M   o
0000160   d   e  \n   1   6   :   0   0   :   0   2   .   3   0   1    
0000200   I   N   F   O   :       G   o   t       e   n   d   p   o   i
0000220   n   t   s       f   o   r       6   7   2       a   c   c   e
0000240   s   s       p   o   i   n   t   s  \n  \0  \0  \0  \0  \0  \0
0000260  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
17777777760  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0   1
20000000000   6   :   0   1   :   5   0   .   0   6   4       I   N   F   O
20000000020   :       S   t   a   r   t   e   d       l   o   g   g   e   r
20000000040  \r  \n   1   6   :   0   1   :   5   0   .   9   0   8       I
20000000060   N   F   O   :       L   o   a   d   e   d       H   T   T   P
20000000100       I   O  \r  \n   1   6   :   0   1   :   5   5   .   2   5
20000000120   2       I   N   F   O   :       L   o   a   d   e   d       D
20000000140   a   t   a   b   a   s   e       I   O  \r  \n   1   6   :   0
20000000160   2   :   0   2   .   9   3   9       I   N   F   O   :       G
20000000200   o   t       e   n   d   p   o   i   n   t   s       f   o   r
20000000220       6   7   3       a   c   c   e   s   s       p   o   i   n
20000000240   t   s  \r  \n
20000000244

This is the whole output of od, it would appear that there's two gigabytes of null being written between the two entries. The first entry was run under Linux, the second under Windows. I don't understand what would cause Tinylog to behave in such a manner, could anyone shed any light on this?

0

There are 0 best solutions below