Chronicle 2.0.3 as logger

367 views
Skip to first unread message

Jatinder Singh

unread,
Feb 24, 2014, 8:49:07 AM2/24/14
to java-ch...@googlegroups.com
Hello Peter

I wanted a low gc solution for logging, which directed me to this awesome project. I would prefer to avoid synchronization/locks while using chronicle for logging. 
I wanted to ask if there is a better approach then to have chronicle as ThreadLocal variable and each thread writing to a separate file?

Also is there a way to configure chronicle to output data file in text format instead of current binary one. (cat {filename} shows the text but less and other unix commands dont display messages properly)

Peter Lawrey

unread,
Feb 24, 2014, 11:28:08 AM2/24/14
to java-ch...@googlegroups.com
I have a concurrent VanillaChronicle and it is lock free and can be shared across processes (in the sandbox area), but you should be aware that is not actually faster than IndexedChronicle.

You can write text to Chronicle instead of binary (which is make more of a difference than using locking) but it is the end of the file which is padded and confuses some tool.  The simplest approach is to use ChronicleReader (which can dump from an index) and dump this to text or grep the output.


--
You received this message because you are subscribed to the Google Groups "Java Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jatinder Singh

unread,
May 15, 2014, 6:41:16 AM5/15/14
to java-ch...@googlegroups.com
Hello Peter

I have been able to log text via chronicle 3 using vanilla configs. The Garbage generation from logger has been reduced drastically. But as a final step i find excerpts are getting prefixed with octals 177775 177777. What would be your suggested solution to eliminate these bytes.

Peter Lawrey

unread,
May 15, 2014, 11:18:53 AM5/15/14
to java-ch...@googlegroups.com
This is the length of the record (with the bits inverted)  IndexedChronicle uses the index to work this but VanillaChronicle can't do this as it is concurrent.  Do you need the data file to be pure text?  There is a chronicle tailer program which you can use to filter messages.  It is not hard to write a tool to copy this to a regular log file if you really need this.


On 15 May 2014 11:41, Jatinder Singh <jatinder...@gmail.com> wrote:
Hello Peter

I have been able to log text via chronicle 3 using vanilla configs. The Garbage generation from logger has been reduced drastically. But as a final step i find excerpts are getting prefixed with octals 177775 177777. What would be your suggested solution to eliminate these bytes.


On Monday, February 24, 2014 9:58:08 PM UTC+5:30, Peter Lawrey wrote:
I have a concurrent VanillaChronicle and it is lock free and can be shared across processes (in the sandbox area), but you should be aware that is not actually faster than IndexedChronicle.

You can write text to Chronicle instead of binary (which is make more of a difference than using locking) but it is the end of the file which is padded and confuses some tool.  The simplest approach is to use ChronicleReader (which can dump from an index) and dump this to text or grep the output.


On 24 February 2014 13:49, Jatinder Singh <jatinder...@gmail.com> wrote:
Hello Peter

I wanted a low gc solution for logging, which directed me to this awesome project. I would prefer to avoid synchronization/locks while using chronicle for logging. 
I wanted to ask if there is a better approach then to have chronicle as ThreadLocal variable and each thread writing to a separate file?

Also is there a way to configure chronicle to output data file in text format instead of current binary one. (cat {filename} shows the text but less and other unix commands dont display messages properly)

--
You received this message because you are subscribed to the Google Groups "Java Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Java Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jatinder Singh

unread,
May 15, 2014, 11:57:58 AM5/15/14
to java-ch...@googlegroups.com
I just found out location in finish method where size bytes were getting written and removed same. I guess that should allow me to write pure text directly using chronicle.


--
You received this message because you are subscribed to a topic in the Google Groups "Java Chronicle" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-chronicle/tkHfm8Ogt10/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-chronicl...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks & Regards
Jatinder

Peter Lawrey

unread,
May 15, 2014, 12:43:32 PM5/15/14
to java-ch...@googlegroups.com

Not sure. It could be possible but this is not tested.

Jatinder Singh

unread,
Jun 13, 2014, 3:01:07 PM6/13/14
to java-ch...@googlegroups.com
Hello Peter

I was able to test chronicle as logger and same reduced GC activity drastically. Since my process is long running I am however facing a issue that reference to memory mapped files not being released from the process while using vanilla chronicle. This forces disk utilization to go very high (even after logged files have been moved) and comes back to normal only if process is restarted. Is there a way in chronicle to force release references to internal RandomAccessFile which are not getting written or after the time cycle has changed?

Peter Lawrey

unread,
Jun 13, 2014, 3:34:28 PM6/13/14
to java-ch...@googlegroups.com
Yes, the number of blocks of data retained was recently increased from 2 to 32 by default.  I have asked to make this configurable and default to a lower number for small machines.

BTW we recommend you have enough free space for a day of activity, if not a week.  This is usually less than a few TB.


--
You received this message because you are subscribed to the Google Groups "Java Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.

Jatinder Singh

unread,
Jun 13, 2014, 11:22:35 PM6/13/14
to java-ch...@googlegroups.com
Hello Peter

Thanks for quick reply. The number of files left opened is much higher than 32. I have seen process taking over a TB of disk space (the data files have been moved from the instance) After which i had to restart same for not closing files. Restart of process makes disk available to be used again. The configured size of data files is 1 GB and index files as 16 MB. Also Major collection never happens in my process, could that cause some issue? 


--
You received this message because you are subscribed to a topic in the Google Groups "Java Chronicle" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-chronicle/tkHfm8Ogt10/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-chronicl...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Peter Lawrey

unread,
Jun 14, 2014, 3:16:22 AM6/14/14
to java-ch...@googlegroups.com

Chronicle is designed to run in an environment without any collectipms incl minor. This sounds like a bug to me.

Jatinder Singh

unread,
Jun 14, 2014, 3:58:05 AM6/14/14
to java-ch...@googlegroups.com
Hello Peter

I am using 3.0.1 version of chronicle with Vanilla Appender. 

Jatinder Singh

unread,
Jun 18, 2014, 8:08:07 AM6/18/14
to java-ch...@googlegroups.com
I have updated chronicle to 3.1.1, Still i find chronicle has references to descriptors of older files.
Reply all
Reply to author
Forward
0 new messages