archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joakim Erdfelt <joa...@erdfelt.com>
Subject Re: more thoughts on proxy logging
Date Mon, 12 Nov 2007 21:53:47 GMT
OK, what I got from this is some proxy logging guidelines.

1) Always include the source repository id
2) Always include the resource being requested
3) Use DEBUG severity level for normal (happy path) events.
4) Use INFO severity level for whitelist / blacklist rejections.
5) Use INFO severity level for transfer rejections due to policy failures.
6) Use WARN severity level for connection / transfer errors from
java.io.* or wagon.

Some questions that are left.
* Do we consider the target repository id to be important to always log?
* Do we show the resource (the path) or the artifact (the
group:artifact:version:classifier:type key) in the log?
* Do we show in the log a "whats left" list of repositories that
can/will be checked next? (and indications if no more proxies are being
checked?)
* Do we log the network proxy setting? that it is being used?
   If so, then at what severity level?

Note: I'm considering creating a ProxyEvents object (or just methods in
DefaultProxyConnector)  to maintain a consistent logging experience.
.logEvent(String sourceRepoId, String targetRepoId, String resource,
String msg)
.logRejection(String sourceRepoId, String targetRepoId, String resource,
String rejectionType, String reason)
.logError(String sourceRepoId, String targetRepoId, String resource,
String where, String reason, boolean continuing)

Idea here it to abstract the logging, and force/remind the developer to
include certain information, and make the formatting consistent (to have
a consistent user experience)

wdyt?

- Joakim

Brett Porter wrote:
> Hi,
>
> I've been trying to figure out how best to address proper diagnostic
> info in proxy logging after finding myself confused when it failed
> recently. I think this can hold until 1.1, but I started a JIRA for
> tracking (MRM-588) and hoped we could discuss it here.
>
> Here is the summary:
>
> I would like to open discussion for what exactly needs to be logged,
> and at what level, for proxy issues to be effectively diagnosed. With
> the current configuration, I was unable to pinpoint some problems easily.
>
> Some thoughts:
>
>     * don't talk about policies, but state what is happening
>     * always include the artifact and repository requested
>     * log more if it results in a NotFoundException
>     * condense information onto fewer lines where possible (if there
> are concurrent requests, without an NDC these will start getting mixed
> up in the logs)
>
> Here are my thoughts:
>
> DEBUG Artifact [x/y/z.jar] will not be requested from remote
> repository [foo] as it didn't match whitelist items
> DEBUG Artifact [x/y/z.jar] will not be requested from remote
> repository [foo] as it matched blacklist item x/**
> INFO Artifact [x/y/z.jar] requested from managed repository
> [internal], checking remote repositories [central,java.net], excluding
> remote repositories [foo]
>
> Then:
> INFO Artifact [x/y/z.jar] retrieved from remote repository [central],
> skipping others
> or
> INFO Artifact [x/y/z.jar] not retrieved as it failed post-download
> policy [bar-policy] (include reason)
>
> And so on...
>
> Thoughts?
>
> An open question is what level to log this at: I feel that it should
> be at INFO, but that might be too noisy by default. Perhaps the right
> thing to do here is to add a connector configuration property that
> says whether to log all requests (and if not, only log at debug level).
>
> Cheers,
> Brett
>
> -- 
> Brett Porter - brett@apache.org
> Blog: http://www.devzuz.org/blogs/bporter/
>
>


Mime
View raw message