Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Issue #231 - Logging Rotation and Levels#295

Merged
ludoch merged 16 commits intoGoogleCloudPlatform:async-supportfrom
jetty-project:bugs/231-julroot
Sep 1, 2016
Merged

Issue #231 - Logging Rotation and Levels#295
ludoch merged 16 commits intoGoogleCloudPlatform:async-supportfrom
jetty-project:bugs/231-julroot

Conversation

@joakime
Copy link

@joakime joakime commented Jun 30, 2016

This PR introduces a bunch of updates to the logging to enable log rotation for both the app_.json and request_.log

We can tweak the rotation numbers in a later commit, but its currently setup as ...

  • app-#.json is at 3 total files of 100MB each (max size)
  • request-#.log is at 3 total files of 10MB each (max size)

This also includes the ability to capture log4j & commons-logging & slf4j and route it to the java.util.logging setup.

request logging is also using this new logging layer (not using the older Jetty FileRollover implementation)

joakime added 6 commits June 23, 2016 14:39
….util.logging

+ Slf4j is now present, capturing logging events from:
  * commons-logging
  * log4j
  * java.util.logging
  * slf4j-api
+ Slf4j is configured to use java.util.logging as its source
  for output, appending, handlers, and configuration
+ Introducing appengine-java-logging CoreLogging with ability
  to configure user/app logging then system logging in a
  consisten way.
public static void init(File appConfigFile) throws IOException {
// Use App (User) Configuration specified as a file parameter
if (appConfigFile != null && appConfigFile.exists()) {
debug("Loading User Config (from file): %s", appConfigFile);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the context would be enough to make "User Config" clear or should we say "User log config..." ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we could call it "App Config" if that makes it easier to understand.

logManager.reset(); // close & remove existing handlers, reset existing logger levels
logManager.readConfiguration(is);
} catch (SecurityException | IOException e) {
warning("Warning: caught exception when reading logging properties: %s", configFile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the "Warning" prefix needed now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joakime to reply

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected in commit 846e4d2

@gregw
Copy link
Contributor

gregw commented Jul 13, 2016

@joakime with @aozarov away, I will review/test these changes before we ask @ifigotin to review/merge. So once you have updated for the latest comments and merged to match the latest async-support, ping me and I'll run some tests.

@gregw
Copy link
Contributor

gregw commented Aug 17, 2016

@ludoch I don't think this issue helps/hinders #318, my testing shows same (bad) results for with and without this PR. This PR is simply to establish the log rotation for both logs and a bit of an implementation cleanup. #318 will required changing what we put into the logs.

@ludoch
Copy link
Contributor

ludoch commented Aug 17, 2016

@aozarov Would you have some cycles to review this PR? Thanks.

@ludoch
Copy link
Contributor

ludoch commented Aug 18, 2016

ack

On Wed, Aug 17, 2016 at 3:51 PM, Greg Wilkins notifications@github.com
wrote:

@ludoch https://github.com/ludoch I don't think this issue
helps/hinders #318
#318,
my testing shows same (bad) results for with and without this PR. This PR
is simply to establish the log rotation for both logs and a bit of an
implementation cleanup. #318
#318
will required changing what we put into the logs.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#295 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAE4zY_7tc6ZFOjlW53s0O8PNVOR3_2vks5qg5B4gaJpZM4JBv77
.

@aslo
Copy link

aslo commented Aug 24, 2016

@aozarov Do you have a chance to take another look at this PR? Thanks!

private List<String> events;

public JsonCaptureHandler() {
formatter = new JsonFormatter();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit. Any reason for not assigning in the declaration and avoiding the need for an explicit constructor? Also, could events be final ?

@aozarov
Copy link
Contributor

aozarov commented Aug 26, 2016

Added some comments. Didn't finish my pass. Should be done with it tomorrow.

@joakime
Copy link
Author

joakime commented Aug 26, 2016

Wow @aozarov

Thanks for the review, I'll cover these current ones tomm with a few extra commits to this PR.

return record.getMessage();
}
}

Copy link
Contributor

@aozarov aozarov Aug 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove one empty line

@aozarov
Copy link
Contributor

aozarov commented Aug 26, 2016

Done with my review.

import java.util.logging.Logger;

/**
* The {@link java.util.logging.Handler} responsible for capturing the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, "is responsible"

@aozarov
Copy link
Contributor

aozarov commented Aug 31, 2016

Looks good. I think this comment should still be addressed but fine with merging it as is.

@ludoch
Copy link
Contributor

ludoch commented Sep 1, 2016

LGTM, will merge soon.

@ludoch ludoch merged commit 827670c into GoogleCloudPlatform:async-support Sep 1, 2016
@ludoch
Copy link
Contributor

ludoch commented Sep 1, 2016

Changes in gcr.io/google_appengine/jetty9-compat:githubheadasync

@ludoch
Copy link
Contributor

ludoch commented Sep 2, 2016

revert is pushed as

gcr.io/google_appengine/jetty9-compat:2016-09-02_00000

and

gcr.io/google_appengine/jetty9-compat:githubheadasync

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants