It should work as you expected. You can step through the code server side on
the Log.debug() call and you should see this translate into a logger.debug()
call.

Perhaps the log message formatting is different due to the different logger
(category)?


[I should also point out that log4j has changed in recent releases. Are you
using the latest version?]



On Tue, Nov 3, 2009 at 9:53 AM, John Nichol <[email protected]> wrote:

>  Fred,
>
>
> Fred Sauer wrote:
>
> Server side Log.debug() is a straight call to log4j's debug() method.
>
>  Client side Log.debug() is controlled by gwt-log and optionally (if
> RemoteLogger is enabled) replayed on the server
>
> Ok so that's what I had expected. But in the example I gave you both of the
> messages
>
> 02/11/2009 17:30:06 DEBUG [JavaSpaceClientAccessManager Update Read/
> Dispatch Thread] (ServerLogImplLog4J.java:43) - Adding 1 to
> HTTPSession k8dnl9klztex length is 2
> 2009-11-02 17:30:06,323 [INFO ] Have received updates that need
> dispatching, updates size is 1
>
> are generated on the server side, one using Log.debug and the other
> LOGGER.info where LOGGER is a log4j logger created with
>
> public static final Logger LOGGER =
> Logger.getLogger(ClientAccessManagerServiceImpl.class.getName());
>
> What I am still unclear on why the Log.debug() message is appearing in the
> log at all, as I have the level set to INFO, in both .gwt.xml and
> log4.properties, and also why the logging formatting differs on the server
> side.
>
> I was expecting the server side logging to drop through to log4j, and
> therefore the log4j.properties file.
>
> This isn't a big deal for me as I can simply replace the use of Log on the
> server side with direct calls to Log4j Logger (LOGGER). I am just curious as
> to how your logging system on the server side is getting configured.
>
> John
>
>
> On Tue, Nov 3, 2009 at 12:30 AM, John Nichol <[email protected]>wrote:
>
>>  Fred Sauer wrote:
>>
>>
>>
>> On Mon, Nov 2, 2009 at 9:37 AM, John <[email protected]> wrote:
>>
>>>
>>> Hi,
>>>
>>> I am using remote logger with log4j. I have a log4j properties set up
>>> in a log4j.properties and while that seems to be working fine for
>>> messages I send straight to log4j the gwt-log messages produced in the
>>> server do not seem to have the same format or to be obaying the rules
>>> for what level of messages get printed out. e.g. here are two
>>> consequtive lines from the console, the first generated with a Log4j
>>> Logger the second using Log.debug() from gwt-log
>>>
>>> 02/11/2009 17:30:06 DEBUG [JavaSpaceClientAccessManager Update Read/
>>> Dispatch Thread] (ServerLogImplLog4J.java:43) - Adding 1 to
>>> HTTPSession k8dnl9klztex length is 2
>>> 2009-11-02 17:30:06,323 [INFO ] Have received updates that need
>>> dispatching, updates size is 1
>>>
>>> I have log4j.properties set up to log at INFO level and the layout is
>>>
>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>> log4j.appender.R.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss} %5p
>>> [%t]  (%F:%L) - %m%n
>>>
>>> So I have two questions.
>>> 1. How do you configure the log4j output of the remote logger?
>>>
>> http://code.google.com/p/gwt-log/wiki/GettingStarted
>>  specifically this sections:
>>
>>    <!--
>>     Inspired by Apache log4j PatternLayout:
>>     
>> http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html
>>
>>
>>   -->
>>
>>    <set-configuration-property name="log_pattern" value="%d [%-5p] %m%n" />
>>
>>
>>    I see, so the server side logging configuration come from the .gwt.xml
>> as well as the client side? I still don't understand why I am seeing the
>> Log.debug() generated in the Servlet code appearing in the Log4j output as I
>> have the log level in the gwt.xml set to INFO
>>
>>   <!-- For development a default of `DEBUG` is recommended -->
>>   <inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
>>   <extend-property name="log_level" values="INFO"/>
>>   <!-- <set-property name="log_WindowLogger" value="ENABLED" /> -->
>>
>>   <set-property name="log_DivLogger" value="DISABLED" />
>>   <set-property name="log_RemoteLogger" value="ENABLED" />
>>
>>   2. Is gwt-log designed to allow use of the Log.xxx methods server
>>> side.
>>>
>>>
>>  Yes :)
>>
>>
>>
>>
>>> Thanks,
>>>
>>> J
>>>
>>>
>>>
>>>
>>
>>
>> --
>>  Fred Sauer
>> Developer Advocate
>> Google Inc.1600 Amphitheatre Parkway
>> Mountain View, CA 94043
>> [email protected]
>>
>>
>>
>>
>>
>>
>> --
>>  *John Nichol* *
>> Principal* *
>> Cloudscape Solutions (Part of Lime Interactive Limited)*
>>
>> Phone:    +44 (0) 20 3239 8205
>> Mobile:    +44 (0) 7976 748 843
>>
>> *www.cloudscapesolutions.com <http://www.cloudscaoesolutions.com/>
>> *
>> *The information in this e-mail is confidential and may be legally
>> privileged. It is intended solely for the addressee. If you are not the
>> intended recipient please delete and do not disclose to another person or
>> use, copy or forward all or any of it in any form. Any views expressed in
>> this message are those of the individual sender, except where the sender
>> specifically states them to be the views of Lime Interactive Ltd. *
>>
>>
>>
>
>
> --
> Fred Sauer
> Developer Advocate
> Google Inc.1600 Amphitheatre Parkway
> Mountain View, CA 94043
> [email protected]
>
>
>
>
>
>
> --
>  *John Nichol* *
> Principal* *
> Cloudscape Solutions (Part of Lime Interactive Limited)*
>
> Phone:    +44 (0) 20 3239 8205
> Mobile:    +44 (0) 7976 748 843
>
> *www.cloudscapesolutions.com <http://www.cloudscaoesolutions.com/>
> *
> *The information in this e-mail is confidential and may be legally
> privileged. It is intended solely for the addressee. If you are not the
> intended recipient please delete and do not disclose to another person or
> use, copy or forward all or any of it in any form. Any views expressed in
> this message are those of the individual sender, except where the sender
> specifically states them to be the views of Lime Interactive Ltd. *
>
> >
>


-- 
Fred Sauer
Developer Advocate
Google Inc.1600 Amphitheatre Parkway
Mountain View, CA 94043
[email protected]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"gwt-log" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-log?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to