[
https://issues.apache.org/jira/browse/WICKET-1946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jeremy Thomerson updated WICKET-1946:
-------------------------------------
Attachment: 1946-requestlogger.patch
Here's a patch to do this.
> Please make RequestLogger.log(RequestData, SessionData) protected
> -----------------------------------------------------------------
>
> Key: WICKET-1946
> URL: https://issues.apache.org/jira/browse/WICKET-1946
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.3.6, 1.4-RC2
> Reporter: Jeremy Thomerson
> Priority: Trivial
> Fix For: 1.3.6, 1.4-RC2
>
> Attachments: 1946-requestlogger.patch
>
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> Could we please make the method above protected (rather than private). This
> makes it very simple to do something like this:
>
> @Override
> protected IRequestLogger newRequestLogger() {
> return new RequestLogger() {
> @Override
> protected void log(RequestData rd, SessionData sd) {
> // do my custom logging HERE
> }
> };
> }
>
> ALSO - it would be real nice if at the same time you extract that creation of
> the AppendingStringBuffer to a method, so that the log method now looks like:
>
> protected void log(RequestData rd, SessionData sd)
> {
> if (log.isInfoEnabled())
> {
> log.info(createStringBuffer(rd, sd, true);
> }
> }
> protected final void createStringBuffer(RequestData rd, SessionData sd,
> boolean includeRuntimeInfo)
> {
> ... all of the stuff that was taken out of log that creates the ASB
> if (includeRuntimeInfo)
> {
> Runtime runtime = Runtime.getRuntime();
> long max = runtime.maxMemory() / 1000000;
> long total = runtime.totalMemory() / 1000000;
> long used = total - runtime.freeMemory() / 1000000;
> asb.append(",maxmem=");
> asb.append(max);
> asb.append("M,total=");
> asb.append(total);
> asb.append("M,used=");
> asb.append(used);
> asb.append("M");
> }
> return asb;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.