You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Prashant Rajput <pr...@infocepts.com> on 2011/01/22 23:09:26 UTC

writing logs on a separate server while the project as jar file

Hi,

I am deploying my Java application on tibco server and this server has its
own log configuration. When I try to write log on this server I have to
write separate line of code into each java class I am having.

So can anybody tell me what exactly is the best way to write logs to a
different server log file, when your application will only goes in as a jar
file over there. My team is not deploying it onthat server we are just
providing the JAR file having logger statements.

Thanks and Regards,
--------------------------------------------------------------------------------------------------------------------
Prashant Rajput| Prashant.Rajput.consultant@Nielsen.com
 Off: +91 712 224 5867 Ext 380, +1 301 560 2591 Ext 380,Mob:+91 9561508836
--------------------------------------------------------------------------------------------------------------------

Re: writing logs on a separate server while the project as jar file

Posted by Prashant Rajput <pr...@infocepts.com>.
Thanks for your reply.

On Mon, Jan 24, 2011 at 7:05 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Prashant,
>
> On 1/24/2011 8:25 PM, Prashant Rajput wrote:
> > I am not using console output, its the latest version of stable log4j
> > release.
>
> Log4j can be configured to log to as many places as you want.
>
> I agree with Chuck: this has absolutely nothing to do with Tomcat. Your
> library isn't interacting with Tomcat, it's being used by some other
> software.
>
> > What exactly I need is something that is the standard way to write logs
> to a
> > server where there are many Java application are deployed as separate jar
> > file and is being used by the tibco processes.
>
> If you can't get access to the servlet container to perform logging on
> your behalf, then your only recourse is to use log4j's capabilities. Or
> Tibco's for that matter.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk0+PgkACgkQ9CaO5/Lv0PC9lACfReOzgzPfBRpQx3NJShtW3hvM
> ma4An0yYjgFn/h2S5FS/vbwW4RUXyUqV
> =w0Og
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Thanks and Regards,
--------------------------------------------------------------------------------------------------------------------
Prashant Rajput| Prashant.Rajput.consultant@Nielsen.com
 Off: +91 712 224 5867 Ext 380, +1 301 560 2591 Ext 380,Mob:+91 9561508836
--------------------------------------------------------------------------------------------------------------------

Re: writing logs on a separate server while the project as jar file

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/1/25 Christopher Schultz <ch...@christopherschultz.net>:
>
>> What exactly I need is something that is the standard way to write logs to a
>> server where there are many Java application are deployed as separate jar
>> file and is being used by the tibco processes.
>
> If you can't get access to the servlet container to perform logging on
> your behalf, then your only recourse is to use log4j's capabilities. Or
> Tibco's for that matter.
>

Just a note: for a library it might be undesirable to use log4j
directly. Many ASF libraries use commons-logging library [1] as a
wrapper around the actual logging implementation. That said, I know
nothing about tibco.

[1] http://commons.apache.org/logging/

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: writing logs on a separate server while the project as jar file

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Prashant,

On 1/24/2011 8:25 PM, Prashant Rajput wrote:
> I am not using console output, its the latest version of stable log4j
> release.

Log4j can be configured to log to as many places as you want.

I agree with Chuck: this has absolutely nothing to do with Tomcat. Your
library isn't interacting with Tomcat, it's being used by some other
software.

> What exactly I need is something that is the standard way to write logs to a
> server where there are many Java application are deployed as separate jar
> file and is being used by the tibco processes.

If you can't get access to the servlet container to perform logging on
your behalf, then your only recourse is to use log4j's capabilities. Or
Tibco's for that matter.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0+PgkACgkQ9CaO5/Lv0PC9lACfReOzgzPfBRpQx3NJShtW3hvM
ma4An0yYjgFn/h2S5FS/vbwW4RUXyUqV
=w0Og
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: writing logs on a separate server while the project as jar file

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Prashant Rajput [mailto:prajput@infocepts.com] 
> Subject: Re: writing logs on a separate server while the project as jar file

> The application is not deployed as a complete web application as 
> this is being used inside the processes of tibco.

Let's back up a step; does this have anything to do with Tomcat?  Shouldn't you be talking to Tibco support?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: writing logs on a separate server while the project as jar file

Posted by Prashant Rajput <pr...@infocepts.com>.
Hi,

I am not using console output, its the latest version of stable log4j
release.

The application is not deployed as a complete web application as this is
being used inside the processes of tibco. So the TIBCO processes used this
application to generate the query, by simply giving in the inputs and
considering the String output. I have implemented logger and the
configuration file resides inside the tibco server, not inside my Java
application. So I am fetching an instance of logger form the tibco server
but for this I have to write separate code in each Java class willing to
write logs somewhere in tibco server.

What exactly I need is something that is the standard way to write logs to a
server where there are many Java application are deployed as separate jar
file and is being used by the tibco processes.

Thanks for Replying.
Prashant Rajput.

On Sat, Jan 22, 2011 at 5:08 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Prashant Rajput [mailto:prajput@infocepts.com]
> > Subject: writing logs on a separate server while the project as jar file
>
> > I am deploying my Java application on tibco server and
> > this server has its own log configuration. When I try to
> > write log on this server I have to write separate line
> > of code into each java class I am having.
>
> > So can anybody tell me what exactly is the best way to
> > write logs to a different server log file, when your
> > application will only goes in as a jar file over there.
> > My team is not deploying it onthat server we are just
> > providing the JAR file having logger statements.
>
> First off, if you're only supplying a .jar file, you're not delivering a
> complete webapp, but rather just some (perhaps all) of the classes of the
> webapp.  A webapp consists of more than just classes; consult the servlet
> spec for the additional spec-defined items such as WEB-INF/web.xml.  Also, a
> complete webapp contains a WEB-INF/classes directory, where items such as
> logging configuration files may be placed.
>
> Second, I hope you're using an actual logging facility (such as log4j), not
> just blindly dumping things to System.out or System.err.  All proper logging
> facilities provide for some means of configuring the level of the detail and
> the output location; whoever is creating the full webapp (of which your .jar
> is just a portion) has the responsibility of setting up the logging
> configuration appropriate for the installation.
>
> If you have been lazy and used System.out or System.err for logging, the
> person configuring the complete webapp can set swallowOutput="true" in the
> <Context> element for the webapp.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Thanks and Regards,
--------------------------------------------------------------------------------------------------------------------
Prashant Rajput| Prashant.Rajput.consultant@Nielsen.com
 Off: +91 712 224 5867 Ext 380, +1 301 560 2591 Ext 380,Mob:+91 9561508836
--------------------------------------------------------------------------------------------------------------------

RE: writing logs on a separate server while the project as jar file

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Prashant Rajput [mailto:prajput@infocepts.com] 
> Subject: writing logs on a separate server while the project as jar file

> I am deploying my Java application on tibco server and 
> this server has its own log configuration. When I try to
> write log on this server I have to write separate line
> of code into each java class I am having.

> So can anybody tell me what exactly is the best way to
> write logs to a different server log file, when your
> application will only goes in as a jar file over there.
> My team is not deploying it onthat server we are just
> providing the JAR file having logger statements.

First off, if you're only supplying a .jar file, you're not delivering a complete webapp, but rather just some (perhaps all) of the classes of the webapp.  A webapp consists of more than just classes; consult the servlet spec for the additional spec-defined items such as WEB-INF/web.xml.  Also, a complete webapp contains a WEB-INF/classes directory, where items such as logging configuration files may be placed.

Second, I hope you're using an actual logging facility (such as log4j), not just blindly dumping things to System.out or System.err.  All proper logging facilities provide for some means of configuring the level of the detail and the output location; whoever is creating the full webapp (of which your .jar is just a portion) has the responsibility of setting up the logging configuration appropriate for the installation.

If you have been lazy and used System.out or System.err for logging, the person configuring the complete webapp can set swallowOutput="true" in the <Context> element for the webapp.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org