Log4j configuration
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Log4j configuration




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

krishna prasad is offline     Log4j configuration  
krishna prasad


View Ip Address Report This Message To A Moderator Edit/Delete Message


Click Here to See the Profile for krishna prasad Click here to Send krishna prasad a Private Message Find more posts by krishna prasad Add krishna prasad to your buddy list
 
12-01-04 03:34 AM

Hi,
Does Websphere portal server supports apache log4j ? Please let me know how 
to configure the same.




[ Post a follow-up to this message ]



    Re: Log4j configuration  
Scott A. Roehrig


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-02-04 01:18 PM

WebSphere Portal Server itself uses the WAS logging APIs and exposes several
logging API though the portlets.

Use of log4j within a portlet is possible and would include requiring the
necessary log4j jars in the portlet with the configuration file. Another
alternative might be a WAS shared library.

In general, log4j was designed to be usable from any Java context. WAS
itself does not provide the jars, but
that doesn't prohibit you from doing so.

Scott

"krishna prasad" <krishna.prasad.1gkupa@mail.webservertalk.com> wrote in
message news:krishna.prasad.1gkupa@mail.webservertalk.com...
>
> Hi,
> Does Websphere portal server supports apache log4j ? Please let me know
> how to configure the same.
>
>
>
> --
> krishna prasad
> ------------------------------------------------------------------------
> Posted via http://www.webservertalk.com
> ------------------------------------------------------------------------
> View this thread: http://www.webservertalk.com/message554069.html
>







[ Post a follow-up to this message ]



    Re: Log4j configuration  
Jeff Knecht


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-07-04 01:48 AM

The following 4 steps can be followed to use log4j in a portlet:

1.  Place commons-logging.jar and log4j.jar in the WEB-INF/lib directory
of the portlet war file.


2.  Create a text file named commons-logging.properties in the
WEB-INF/classes directory and set the LogFactory:

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jF
actory


3.  Create a text file named log4j.properties in the WEB-INF/classes
directory.  Just follow the directions provided by the log4j docs.  One
thing you can do to make life easy (assuming you're logging to a file)
is to use a built-in WebSphere variable to designate the location of the
file to be the same location as SystemOut.log, etc - like this:

log4j.appender.R.File=${SERVER_LOG_ROOT}/my_portlet.log


4.  After the application is installed, ensure the Classloader Mode in
BOTH the enterprise application and the web module to PARENT_LAST.  If
you don't do this, the portal logger will take over logging and your
log4j settings will have no effect.



Scott A. Roehrig wrote:
> WebSphere Portal Server itself uses the WAS logging APIs and exposes sever
al
> logging API though the portlets.
>
> Use of log4j within a portlet is possible and would include requiring the
> necessary log4j jars in the portlet with the configuration file. Another
> alternative might be a WAS shared library.
>
> In general, log4j was designed to be usable from any Java context. WAS
> itself does not provide the jars, but
> that doesn't prohibit you from doing so.
>
> Scott
>
> "krishna prasad" <krishna.prasad.1gkupa@mail.webservertalk.com> wrote in
> message news:krishna.prasad.1gkupa@mail.webservertalk.com...
> 
>
>
>





[ Post a follow-up to this message ]



    Re: Log4j configuration  
Lee Francis Wilhelmsen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-09-04 12:58 PM

Jeff Knecht wrote:
> 3.  Create a text file named log4j.properties ...
> One
> thing you can do to make life easy (assuming you're logging to a file)
> is to use a built-in WebSphere variable to designate the location of the
> file to be the same location as SystemOut.log, etc - like this:
>
> log4j.appender.R.File=${SERVER_LOG_ROOT}/my_portlet.log

Hi

This seemed like a neat trick so I tried this using the WSAD (5.1.2)
portal test environment, but the log file never appears in the expected
log directory. I also tried to deploy it on the company portal server
with the same result. In both cases it always gets created at the root.

So if my wsad installation is in c:\wsad then the log file gets created
in the c:\ root directory when it should have been
c:\wsad\runtimes\portal_v50\log. Can any one tell me why this is?

The SERVER_LOG_ROOT variable seems to be present in the test server
substitution variables tab unders server settings (WSAD) and points to
${WPS_HOME}/log. The WPS_HOME variable points to the correct setting (I
actually had to change it for my test environment), but still no log
file in the log directory...

I'm running on IBM WebSphere Portal 5.0.2.1. The "usual" WPS log files
(wps_YYYY.MM.DD-HH.MM.SS.log) always get created in the log directory so
that's working as normal. However, I noticed this at the top of a log file:

Installation
----------------------------------------------------------------------------
----
Product Directory   E:\wsad\runtimes\portal_v50
Version Directory   ${product.dir}\version
DTD Directory       ${version.dir}\dtd
Log Directory       ${version.dir}\log
Backup Directory    ${version.dir}\backup
TMP Directory       C:\DOCUME~1\LEE~1.DIN\LOCALS~1\Temp

Notice the "Log Directory" value. I tried to use the value
${version.dir}\log in my log4j.properties file, but got exact same
results as before.

Can anyone see what's wrong?

Regards
Lee Francis





[ Post a follow-up to this message ]



    Re: Log4j configuration  
Scott A. Roehrig


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-09-04 11:21 PM

The configuration of log4j would be done solely by the log4j configuration
file. It has no knowledge of WAS shortcut paths or the like. You would need
to manually specify the location in the configuration file.

Scott

"Lee Francis Wilhelmsen" <leefw@start.no-n-o-s-p-a-m> wrote in message
news:cp9f54$4foi$1@news.boulder.ibm.com...
> Jeff Knecht wrote: 
>
> Hi
>
> This seemed like a neat trick so I tried this using the WSAD (5.1.2)
> portal test environment, but the log file never appears in the expected
> log directory. I also tried to deploy it on the company portal server with
> the same result. In both cases it always gets created at the root.
>
> So if my wsad installation is in c:\wsad then the log file gets created in
> the c:\ root directory when it should have been
> c:\wsad\runtimes\portal_v50\log. Can any one tell me why this is?
>
> The SERVER_LOG_ROOT variable seems to be present in the test server
> substitution variables tab unders server settings (WSAD) and points to
> ${WPS_HOME}/log. The WPS_HOME variable points to the correct setting 
(I
> actually had to change it for my test environment), but still no log file
> in the log directory...
>
> I'm running on IBM WebSphere Portal 5.0.2.1. The "usual" WPS log files
> (wps_YYYY.MM.DD-HH.MM.SS.log) always get created in the log directory so
> that's working as normal. However, I noticed this at the top of a log
> file:
>
> Installation
> --------------------------------------------------------------------------
------
> Product Directory   E:\wsad\runtimes\portal_v50
> Version Directory   ${product.dir}\version
> DTD Directory       ${version.dir}\dtd
> Log Directory       ${version.dir}\log
> Backup Directory    ${version.dir}\backup
> TMP Directory       C:\DOCUME~1\LEE~1.DIN\LOCALS~1\Temp
>
> Notice the "Log Directory" value. I tried to use the value
> ${version.dir}\log in my log4j.properties file, but got exact same re
sults
> as before.
>
> Can anyone see what's wrong?
>
> Regards
> Lee Francis







[ Post a follow-up to this message ]



    Re: Log4j configuration  
Lee Francis Wilhelmsen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-10-04 07:56 AM

Scott A. Roehrig wrote:
> The configuration of log4j would be done solely by the log4j configuration
> file. It has no knowledge of WAS shortcut paths or the like. You would nee
d
> to manually specify the location in the configuration file.

So what you're saying is that
log4j.appender.R.File=${SERVER_LOG_ROOT}/my_portlet.log
or the like won't work becuase log4j has no knowledge of WAS/WPS
shortcut paths?

Regards
Lee Francis





[ Post a follow-up to this message ]



    Re: Log4j configuration  
Scott A. Roehrig


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-10-04 10:59 PM

To my knowledge that is correct. The WAS shortcuts won't be surfaced to the
log4j.configuration file.

"Lee Francis Wilhelmsen" <leefw@start.no-n-o-s-p-a-m> wrote in message
news:cpbics$55gc$1@news.boulder.ibm.com...
> Scott A. Roehrig wrote: 
>
> So what you're saying is that
> log4j.appender.R.File=${SERVER_LOG_ROOT}/my_portlet.log
> or the like won't work becuase log4j has no knowledge of WAS/WPS shortcut
> paths?
>
> Regards
> Lee Francis







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:57 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register