Coder Social home page Coder Social logo

Comments (6)

peter-lawrey avatar peter-lawrey commented on July 29, 2024

I think this is a reasonable approach.

Longer term, I would like to serialize an Exception in a text form which
allows deserialization, however can be read without the class which created
it.

On 10 March 2015 at 21:03, Alexandre Victoor [email protected]
wrote:

Hello
This ticket is related to the comments of former ticket 15
When a binary appender is used, an exception is serialized with serializer
"JDKZObjectSerializer". This implies that you cannot read logs if you do
not have in your classpath the exception classes that have been used by the
application that has generated the logs.
This forbid to use ChroniTail, ChroniCat and the other tools working as
standalone tools...
Also this almost forbid applications to refactor their exception classes.
Instead of serializing the exception itself, I think that the logger
should serialize an object containing two strings:

  1. the exception message
  2. the exception stack trace as a string


Reply to this email directly or view it on GitHub
#26.

from chronicle-logger.

lburgazzoli avatar lburgazzoli commented on July 29, 2024

It is reasonable for exceptions but it doesn't for other objects so if you call logger.info("got {}", obj, except) to a binary appender , exception will be always readable but obj won't unless you have it in the class-path. The simplest way to have an 'open' log is to use a TextAppendet which format the message and serialized exceptions as strings.

I can easily add an option to serialize exception as strings but as mentioned above, non simple objects require the class to be available, is that an acceptable limitation?

I can also add an option to chronicle to serialize objects without compression.

from chronicle-logger.

alexvictoor avatar alexvictoor commented on July 29, 2024

Thanks for your responses
Is there any doc on how works a binary chronicle/appender vs a text one?
I have done a few tests and even when i just log a string, the binary appender is much faster than the text one. I do not get why? Compression is done by default?

from chronicle-logger.

lburgazzoli avatar lburgazzoli commented on July 29, 2024

Not at the moment but I will document the difference between binary and text as soon as possible.

The main difference is that binary use buffer.write(...) wich write bytes (i.e. 4 bit for an int) whereas text uses buffer.append(...) which write thing in a human readable form (similar to append strings); in addition the TextAppender need to format the message (i.e. the logback appender invokes ILoggingEvent.getFormattedMessage).

Yes at the moment compression is done by default, I will add an option to Chronicle V3 to disable it.

from chronicle-logger.

alexvictoor avatar alexvictoor commented on July 29, 2024

Thanks!
much more clear now. I was not aware that I could use the Externalizable interface and did not know BytesMarshallable and DataValueClasses...
BTW next month I will do a talk at devoxx france and I will talk a little bit of openhft 👍

from chronicle-logger.

lburgazzoli avatar lburgazzoli commented on July 29, 2024

@alexvictoor can we close this issue ?

from chronicle-logger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.