Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Ahead warp factor 1" -- Captain Kirk


devel / comp.lang.java.programmer / How do you log your Java?

SubjectAuthor
* How do you log your Java?e.d.pro...@gmail.com
`* Re: How do you log your Java?Arne Vajhøj
 `* Re: How do you log your Java?e.d.pro...@gmail.com
  `- Re: How do you log your Java?Arne Vajhøj

1
How do you log your Java?

<962b2d02-2056-4d40-b7a9-d2730831e349n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9993&group=comp.lang.java.programmer#9993

  copy link   Newsgroups: comp.lang.java.programmer
X-Received: by 2002:a05:622a:18a6:b0:3de:bafb:82c1 with SMTP id v38-20020a05622a18a600b003debafb82c1mr1780009qtc.3.1679319106014;
Mon, 20 Mar 2023 06:31:46 -0700 (PDT)
X-Received: by 2002:a25:e90b:0:b0:914:fc5e:bbec with SMTP id
n11-20020a25e90b000000b00914fc5ebbecmr4109728ybd.13.1679319105698; Mon, 20
Mar 2023 06:31:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!diablo1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.java.programmer
Date: Mon, 20 Mar 2023 06:31:45 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=98.237.40.232; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host: 98.237.40.232
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <962b2d02-2056-4d40-b7a9-d2730831e349n@googlegroups.com>
Subject: How do you log your Java?
From: e.d.prog...@gmail.com (e.d.pro...@gmail.com)
Injection-Date: Mon, 20 Mar 2023 13:31:46 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1827
 by: e.d.pro...@gmail.com - Mon, 20 Mar 2023 13:31 UTC

Do you use log4j2 or something else?

How do you redirect the catalina logs to a file? If I have log4j2.xml in the tomcat folder, it appears to be ignoring the log4j2.xml in the application folder.

Do you use log4j2.xml? This appears to be the popular setup, but the last application I worked with had many different project for pieces of the one big application, so I put them all under one master project and had the spring framework call the API to configure on startup, seemed easier than using xml files especially if the sub-projects can share and would each need their own xml file.

Do you use the static method at the start of each class Logger log = LoggerFactory.getLogger() or the @Log4j2 annotation, or is there another better way?

Re: How do you log your Java?

<tv9ora$3i8e5$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9994&group=comp.lang.java.programmer#9994

  copy link   Newsgroups: comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.lang.java.programmer
Subject: Re: How do you log your Java?
Date: Mon, 20 Mar 2023 09:59:05 -0400
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <tv9ora$3i8e5$1@dont-email.me>
References: <962b2d02-2056-4d40-b7a9-d2730831e349n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Mar 2023 13:59:07 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="73bf9460c09b1edc5c4d415813f5bb2c";
logging-data="3744197"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lOvJBwlnXwIIDJrKCk8HpxqBivOYdJAw="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:vqXLL5LftXScdrmF6i6gXInFbkg=
In-Reply-To: <962b2d02-2056-4d40-b7a9-d2730831e349n@googlegroups.com>
Content-Language: en-US
 by: Arne Vajhøj - Mon, 20 Mar 2023 13:59 UTC

On 3/20/2023 9:31 AM, e.d.pro...@gmail.com wrote:
> Do you use log4j2 or something else?
>
> How do you redirect the catalina logs to a file? If I have log4j2.xml
> in the tomcat folder, it appears to be ignoring the log4j2.xml in the
> application folder.
>
> Do you use log4j2.xml? This appears to be the popular setup, but the
> last application I worked with had many different project for pieces
> of the one big application, so I put them all under one master
> project and had the spring framework call the API to configure on
> startup, seemed easier than using xml files especially if the
> sub-projects can share and would each need their own xml file.
>
> Do you use the static method at the start of each class Logger log =
> LoggerFactory.getLogger() or the @Log4j2 annotation, or is there
> another better way?

I believe the popularity ranking is:
1) logback
2) log4j 2.x
3) jul
4) log4j 1.x (obsolete, deprecated)

The big benefit of configuration files over programmatic
configuration is that it allows operations to change logging
without requiring help from software engineering.

@Log4j2 annotation is a Lombok feature I believe, so only
a possibility for those using Lombok.

Arne

Re: How do you log your Java?

<25b108ad-ea16-4b59-ba4e-3660336349d8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9995&group=comp.lang.java.programmer#9995

  copy link   Newsgroups: comp.lang.java.programmer
X-Received: by 2002:a37:e119:0:b0:746:3c7f:7524 with SMTP id c25-20020a37e119000000b007463c7f7524mr2753423qkm.14.1679321111067;
Mon, 20 Mar 2023 07:05:11 -0700 (PDT)
X-Received: by 2002:a05:6902:1026:b0:b69:12aa:782c with SMTP id
x6-20020a056902102600b00b6912aa782cmr6263889ybt.6.1679321110703; Mon, 20 Mar
2023 07:05:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!diablo1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.java.programmer
Date: Mon, 20 Mar 2023 07:05:10 -0700 (PDT)
In-Reply-To: <tv9ora$3i8e5$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=98.237.40.232; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host: 98.237.40.232
References: <962b2d02-2056-4d40-b7a9-d2730831e349n@googlegroups.com> <tv9ora$3i8e5$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <25b108ad-ea16-4b59-ba4e-3660336349d8n@googlegroups.com>
Subject: Re: How do you log your Java?
From: e.d.prog...@gmail.com (e.d.pro...@gmail.com)
Injection-Date: Mon, 20 Mar 2023 14:05:11 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1939
 by: e.d.pro...@gmail.com - Mon, 20 Mar 2023 14:05 UTC

> I believe the popularity ranking is:
> 1) logback
> 2) log4j 2.x
> 3) jul
> 4) log4j 1.x (obsolete, deprecated)

What is logback? I've seen this and thought it was just an older version of the log4j.
I haven't heard of a jul logging.

> The big benefit of configuration files over programmatic
> configuration is that it allows operations to change logging
> without requiring help from software engineering.

You can use the API to set up log4j configuration and read configuration from something someone other than the developer can edit.

> @Log4j2 annotation is a Lombok feature I believe, so only
> a possibility for those using Lombok.
>
> Arne

Is the annotation just a shorter version of that one line factory statement or is there another benefit?

Re: How do you log your Java?

<tv9pi9$3i8e5$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9996&group=comp.lang.java.programmer#9996

  copy link   Newsgroups: comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.lang.java.programmer
Subject: Re: How do you log your Java?
Date: Mon, 20 Mar 2023 10:11:21 -0400
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <tv9pi9$3i8e5$2@dont-email.me>
References: <962b2d02-2056-4d40-b7a9-d2730831e349n@googlegroups.com>
<tv9ora$3i8e5$1@dont-email.me>
<25b108ad-ea16-4b59-ba4e-3660336349d8n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Mar 2023 14:11:21 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="73bf9460c09b1edc5c4d415813f5bb2c";
logging-data="3744197"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/596UZZrkm1j1euU4DC1+kUFCn9B1fLbA="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:1cuGCabNgdDKf7nxX/yWTfkWQCc=
In-Reply-To: <25b108ad-ea16-4b59-ba4e-3660336349d8n@googlegroups.com>
Content-Language: en-US
 by: Arne Vajhøj - Mon, 20 Mar 2023 14:11 UTC

On 3/20/2023 10:05 AM, e.d.pro...@gmail.com wrote:
>> I believe the popularity ranking is:
>> 1) logback
>> 2) log4j 2.x
>> 3) jul
>> 4) log4j 1.x (obsolete, deprecated)
>
> What is logback? I've seen this and thought it was just an older version of the log4j.
> I haven't heard of a jul logging.

https://logback.qos.ch/

It is different from but similar to log4j.

>> @Log4j2 annotation is a Lombok feature I believe, so only
>> a possibility for those using Lombok.
>
> Is the annotation just a shorter version of that one line factory statement or is there another benefit?

I don't use Lombok, but:

https://projectlombok.org/api/lombok/extern/log4j/Log4j

says:

<quote>
Example:

@Log4j
public class LogExample {
}

will generate:

public class LogExample {
private static final org.apache.log4j.Logger log =
org.apache.log4j.Logger.getLogger(LogExample.class);
}
</quote>

Arne

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor