You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by Peter Tran <pt...@pivotal.io> on 2019/01/03 16:17:05 UTC
Geode Version in the logs
Hello,
Is it possible to prepend every log message with the current Geode version?
I think it might help with debugging. I'm not sure how something like this
would work as the software wouldn't really know how to read metadata about
itself?
Has something like this been attempted in the past? I would love your
opinion on the feasibility of this feature
Thank you!
--
Peter Tran
Re: Geode Version in the logs
Posted by Patrick Rhomberg <pr...@apache.org>.
You can write a custom log4j2.xml to configure logging to your heart's
content. See Geode's and Log4j's documentation in [1] and [2] respectively.
If the string you want to prepend is static, I'm pretty sure that can
happen quite easily in a configuration XML. If it's dynamic, you might
need to write your own Logger class and point to that in the
configuration. I've never had to go that route myself, but I believe
that's how it's intended to work.
[1]
https://geode.apache.org/docs/guide/10/managing/logging/configuring_log4j2.html
[2] https://logging.apache.org/log4j/2.x/manual/configuration.html
On Thu, Jan 3, 2019 at 8:58 AM Nabarun Nag <nn...@apache.org> wrote:
> Just in case you are planning to write tests consisting of multiple
> versions of Apache Geode simultaneously, you can look into any
> RollingUpgradeDUnitTest. Those append the version number before each log
> statement.
>
> Regards
> Nabarun Nag
>
> On Thu, Jan 3, 2019 at 8:53 AM Jacob Barrett <jb...@pivotal.io> wrote:
>
> > Given that the version can’t change at runtime it doesn’t make sense to
> > repeatedly print static state of the system. The log does print the
> static
> > state of the system at startup.
> >
> > > On Jan 3, 2019, at 8:17 AM, Peter Tran <pt...@pivotal.io> wrote:
> > >
> > > Hello,
> > >
> > > Is it possible to prepend every log message with the current Geode
> > version?
> > > I think it might help with debugging. I'm not sure how something like
> > this
> > > would work as the software wouldn't really know how to read metadata
> > about
> > > itself?
> > >
> > > Has something like this been attempted in the past? I would love your
> > > opinion on the feasibility of this feature
> > >
> > > Thank you!
> > > --
> > > Peter Tran
> >
>
Re: Geode Version in the logs
Posted by Nabarun Nag <nn...@apache.org>.
Just in case you are planning to write tests consisting of multiple
versions of Apache Geode simultaneously, you can look into any
RollingUpgradeDUnitTest. Those append the version number before each log
statement.
Regards
Nabarun Nag
On Thu, Jan 3, 2019 at 8:53 AM Jacob Barrett <jb...@pivotal.io> wrote:
> Given that the version can’t change at runtime it doesn’t make sense to
> repeatedly print static state of the system. The log does print the static
> state of the system at startup.
>
> > On Jan 3, 2019, at 8:17 AM, Peter Tran <pt...@pivotal.io> wrote:
> >
> > Hello,
> >
> > Is it possible to prepend every log message with the current Geode
> version?
> > I think it might help with debugging. I'm not sure how something like
> this
> > would work as the software wouldn't really know how to read metadata
> about
> > itself?
> >
> > Has something like this been attempted in the past? I would love your
> > opinion on the feasibility of this feature
> >
> > Thank you!
> > --
> > Peter Tran
>
Re: Geode Version in the logs
Posted by Jacob Barrett <jb...@pivotal.io>.
Given that the version can’t change at runtime it doesn’t make sense to repeatedly print static state of the system. The log does print the static state of the system at startup.
> On Jan 3, 2019, at 8:17 AM, Peter Tran <pt...@pivotal.io> wrote:
>
> Hello,
>
> Is it possible to prepend every log message with the current Geode version?
> I think it might help with debugging. I'm not sure how something like this
> would work as the software wouldn't really know how to read metadata about
> itself?
>
> Has something like this been attempted in the past? I would love your
> opinion on the feasibility of this feature
>
> Thank you!
> --
> Peter Tran