On Mon, 04 Oct 2004 04:48:42 -0600, "Bill Winspur" <[EMAIL PROTECTED]>
said:
> I am trying to get pipeline debug working, when Studio and Presentation
> Server occupy different JVMs. 

This should always be the case. 

> Presentation server logging is configured 
> (in WEB-INF/resources/config/log4j.xml) with the following:
> 
> <!-- Chainsaw is a graphical appender-->
>     <appender name="ChainsawAppender" 
> class="org.apache.log4j.net.SocketAppender">
>         <param name="RemoteHost" value="localhost"/>
>         <param name="Port" value="4445"/>
>         <param name="LocationInfo" value="true"/>
>     </appender>
> 
> which looks like it should do push logging to port 4445 on the local box.
> 
> On the studio/eclipse side, in directory eclipse/ (my install):
> a) a search for files having names that contain 'log4j', returned no
>    docs.
> b) a search for files containing the string 'SocketReceiver' returned no 
>    docs.

Yeah the Studio documentation is pretty light.  So much so you may
mistake it
for non-existent.

The best, free, reference for the syntax of log4j.xml is the log4j doc.  
This can be found at 
  http://logging.apache.org/log4j/docs/manual.html
and
  http://logging.apache.org/log4j/docs/api/index.html.  
Note that best doesn't imply good.


> I tried to trigger logging, just in case the studio side is set up OK,
> even though I can not find it at present, but nothing showed in the
> logging event window
> 
> Question
> --------
> 1. Is the above appender what I need ?

  That looks OK however just declaring an appender is insufficient.
  You need to have a logger that uses the appender.  

  Attached is an example.

> 2. Where is studio's logging configured ?

  When the Logging Event view is opened it searches the workspace
  for log4j.xml files and uses whatever it find.

-- Dan S
<configuration xmlns="http://jakarta.apache.org/log4j/"; >

    <!-- This declares an appender that writes to System.out -->
    <appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
        <param name="Target" value="System.out"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{ISO8601} %-5p %c %x - %m%n"/>
        </layout>
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            <param name="LevelMin" value="INFO" />
        </filter>
    </appender>

    <!-- This declares an appender that pushes log info to localhost:4445.    -->
    <!-- If nothing is listening the log info will be lost.  In that case you -->
    <!-- should also see errors like 'cannot connect, will try again later'   -->
    <!-- in System.out.                                                       -->
   <appender name="ASocketAppender" class="org.apache.log4j.net.SocketAppender" >
        <!-- For doc on these params look at the javadoc for SocketAppender.  -->
        <!-- ( setRemoteHost, setPort, etc. ) -->
        <param name="RemoteHost" value="localhost"/>
        <param name="Port" value="4445"/>
        <param name="LocationInfo" value="true"/>
    </appender>


    <!-- This configures the root logger to use the above appenders.  It     -->
    <!-- also sets the threshhold for log msgs.  Msgs with a lower value     -->
    <!-- will be lost.                                                       -->
    <!-- Loggers exist in a hierarichical system where the name denotes the  -->
    <!-- position in the hierarchy.  Root is unnamed at the top.  A logger   -->
    <!-- with the name 'foo' would be below root.  One with the name         -->
    <!-- 'foo.bar' would below foo.                                          -->
    <!-- By default loggers use the threshold and appenders of their         -->
    <!-- so by configuring Root as we do here we will see everything that is -->
    <!-- logged and has a priority >= info.                                  -->
    <root>
        <priority value="info"/>
        <appender-ref ref="ConsoleAppender"/>
        <appender-ref ref="ASocketAppender"/>
    </root>

</configuration>

Reply via email to