DBW | 3 Jun 00:00 2010
Picon

SMTPAppender: empty Subject and To

I've successfully configured SMTPAppender to send email, and am receiving emails, but the "Subject"
field is always empty, and the "To" field is always "undisclosed-recipients" rather than the email
address of the recipient(s). Am I doing something wrong? Is there a way to set the Subject? All of the other
header fields are being honored (e.g. From, SMTPHost, SmtpUsername, etc.).

I'm using log4j-1.2.16 and javamail 1.4.3.

Here is my config:

 log4j.appender.SmtpHandler=org.apache.log4j.net.SMTPAppender
 log4j.appender.SmtpHandler.threshold=ERROR
 log4j.appender.SmtpHandler.SMTPHost=mail.<hidden>.com
 log4j.appender.SmtpHandler.SmtpUsername=<hidden>
 log4j.appender.SmtpHandler.SmtpPassword=<hidden>
 log4j.appender.SmtpHandler.Subject=Foo
 log4j.appender.SmtpHandler.To=<hidden>
 log4j.appender.SmtpHandler.From=SomeFromValue <at> <hidden>.com
 log4j.appender.SmtpHandler.bufferSize=512
 log4j.appender.SmtpHandler.layout=org.apache.log4j.PatternLayout

Thanks,

Brad
Douglas E Wegscheid | 3 Jun 15:42 2010

Re: SMTPAppender: empty Subject and To

Can you set log4j.debug=true in your properties? you will get a lof of 
output to System.out, which will tell you how log4j is configuring itself.

btw, your config looks good. any chance that your mail system is doing 
something to the message?

Douglas E Wegscheid
Lead Technical Analyst, Whirlpool Corporation
(269)-923-5278

"A wrong note played hesitatingly is a wrong note. A wrong note played 
with conviction is interpretation."

DBW <dbwbca <at> yahoo.com> wrote on 06/02/2010 06:00:19 PM:

> I've successfully configured SMTPAppender to send email, and am 
> receiving emails, but the "Subject" field is always empty, and the 
> "To" field is always "undisclosed-recipients" rather than the email 
> address of the recipient(s). Am I doing something wrong? Is there a 
> way to set the Subject? All of the other header fields are being 
> honored (e.g. From, SMTPHost, SmtpUsername, etc.).
> 
> I'm using log4j-1.2.16 and javamail 1.4.3.
> 
> Here is my config:
> 
>  log4j.appender.SmtpHandler=org.apache.log4j.net.SMTPAppender
>  log4j.appender.SmtpHandler.threshold=ERROR
>  log4j.appender.SmtpHandler.SMTPHost=mail.<hidden>.com
>  log4j.appender.SmtpHandler.SmtpUsername=<hidden>
(Continue reading)

laredotornado | 3 Jun 23:46 2010
Picon

Chainsaw V2: Possible to create receiver without modifying remote log4j file?


Hi,

I want to setup Chainsaw 2 locally to track log4j logs on a remote machine. 
The thing is that I don't want to have to modify the remote log4j.properties
file, since it is a production file, and modifying production things
requires much bureaucracy here.  Is there a way to configure a receiver to
monitor the remote logs without having to modify that log4j.properties file?

The tutorial I was reading implies that I have to add a new appender to the
remote properties file --
http://www.informit.com/guides/content.aspx?g=java&seqNum=459.

Thanks, - Dave

--

-- 
View this message in context: http://old.nabble.com/Chainsaw-V2%3A-Possible-to-create-receiver-without-modifying-remote-log4j-file--tp28773352p28773352.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Scott Deboy | 3 Jun 23:56 2010
Picon

Re: Chainsaw V2: Possible to create receiver without modifying remote log4j file?

Yes, using Chainsaw with a VFSLogFilePatternReceiver will allow you to
remotely tail log files if they're available via one of the file systems
supported by Jakarta Commons-VFS.

I've used both the sftp:// support to tail a file that's on another server
and accessible via ssh, and smb:// to tail a file that's on a windows server
(smb support is in the Jakarta Commons-VFS sandbox, so you'd have to build
from source).

There is an example receiver configuration available from Chainsaw's Welcome
tab, and information on how to get VFS working with Chainsaw here:
http://logging.apache.org/chainsaw/distributionnotes.html

Link to Jakarta Commons-VFS:
http://commons.apache.org/vfs/
See the 'file system types' link.

If possible, I'd suggest pulling down the log4j companions and Chainsaw from
the svn repo, build using maven, and run that version of Chainsaw....it has
a ton of new features (updated Chainsaw version hopefully released soon).

Scott

On Thu, Jun 3, 2010 at 2:46 PM, laredotornado <laredotornado <at> gmail.com>wrote:

>
> Hi,
>
> I want to setup Chainsaw 2 locally to track log4j logs on a remote machine.
> The thing is that I don't want to have to modify the remote
(Continue reading)

DBW | 5 Jun 22:06 2010
Picon

Re: SMTPAppender: empty Subject and To

Thanks for the response. I set debug=true and didn't find anything of interest, but then I noticed that
geronimo-javamail is on my classpath in addition to sun mail.jar. I suspect this is the root of my problem.

Thanks,

Brad

----- Original Message ----
From: Douglas E Wegscheid 

Can you set log4j.debug=true in your properties? you will get a lof of 
output to System.out, which will tell you how log4j is configuring itself.

btw, your config looks good. any chance that your mail system is doing 
something to the message?

Douglas E Wegscheid
Lead Technical Analyst, Whirlpool Corporation
(269)-923-5278

"A wrong note played hesitatingly is a wrong note. A wrong note played 
with conviction is interpretation."

DBW <dbwbca <at> yahoo.com> wrote on 06/02/2010 06:00:19 PM:

> I've successfully configured SMTPAppender to send email, and am 
> receiving emails, but the "Subject" field is always empty, and the 
> "To" field is always "undisclosed-recipients" rather than the email 
> address of the recipient(s). Am I doing something wrong? Is there a 
> way to set the Subject? All of the other header fields are being 
(Continue reading)

Curt Arnold | 7 Jun 04:23 2010
Picon

Welcome Ralph Goers to the Logging Services PMC

Ralph Goers has been elected to join the Logging Services Project Management Committee.  Ralph is an Apache
Software Foundation member and is also member of the Attic, Cocoon, Portals, Excaliber, Incubator and
Maven PMCs.   Ralph has recently contributed to the log4j 2.0 sandbox and has participated in log4j 2.0
design discussions for nearly two years.
DBW | 10 Jun 21:53 2010
Picon

Re: SMTPAppender: empty Subject and To

I confirmed that my problem was unrelated to log4j and SMTPAppender but was instead caused by
geronimo-javamail-1.4_spec-1.3.jar. The geronimo-javamail .jar is distributed with Apache CXF and
listed as a dependency for CXF, but a search shows that others have had mail formatting problems when using
geronimo-javamail. I simply removed the geronimo-javamail jar from my path and my email problem was solved.

Thanks,

Brad
JohnRodey | 23 Jun 18:47 2010
Picon

Running a SocketServer as a Tomcat managed application


I have a socket server running as a stand-alone process and would like to
have that process run from within Tomcat.

I imagine this is pretty common?  Can I use the Socket Server code that is
already written or would I need to write my own?  Is there any procedures on
doing so?

Thanks
--

-- 
View this message in context: http://old.nabble.com/Running-a-SocketServer-as-a-Tomcat-managed-application-tp28974236p28974236.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
aalok95 | 25 Jun 20:26 2010
Picon

Cannot configure apache-log4j-extras-1.0 with apache-log4j-1????


Hi Friends,

Problem:
I've tried many times to configure apache-log4j-extras-1.0 with
apache-log4j-1.2.16, but it is still failing to load classes from configure
apache-log4j-extras-1.0 JAR file.

What I want to do:
Actually I want to do time based log rotation the my application specific
log files. I could able to configure using
'net.cp.ps.sdk.util.log.DailyRollingFileAppender' class, but few problems
are reported on Apache site for this class.

Solution I can think of:
So, I have to look for another option for
'net.cp.ps.sdk.util.log.DailyRollingFileAppender' class, and I found
'org.apache.log4j.rolling.RollingFileAppender' class and can use
'org.apache.log4j.rolling.TimeBasedRollingPolicy' in that.

Steps I performed so far:
1. Downloaded apache-log4j-extras-1.0 with apache-log4j-1.2.16 JAR files
from web.
2. Renamed apache-log4j-1.2.16.jar to simple 'log4j.jar'.
3. Copied apache-log4j-extras-1.0.jar in ~/WEB-INF/lib directory, where my
old log4j is present.
4. Extracted new log4j.jar (1.2.16).
5. Edited the pom.xml file from new 'log4j.jar' to include
'apache-log4j-extras-1.0'. Steps are described here:
(https://wiki.jasig.org/display/UPM30/log4j.xml).
(Continue reading)

Jacob Kjome | 26 Jun 08:32 2010

Re: Cannot configure apache-log4j-extras-1.0 with apache-log4j-1????


This a clearly a classloading/environment issue unique to uPortal.  I suggest you
ask on their list.  There's nothing I can see that Log4j is doing wrong, at least
not at this point.  In any more standard environment, like Tomcat6, placing
log4j.jar and log4j-extras.jar in WEB-INF/lib would work fine.

One thing you could check is the type of classloading behavior you have
configured.  Is it parent-first (Java's standard classloading) or parent-last
(often provided by containers to deal with classloading issues unique to JEE
environments).  If parent-first, you should check if log4j.jar exists in the
server's classpath.  If it is there, then it will be loaded in preference to the
lgo4j.jar in WEB-INF/lib.  Then if log4j.jar in the server's classpath tries to
load something from log4j-extra.jar in WEB-INF/lib, it won't find it.  Most
servers allow you configure classloading behavior.  Find the option to set it to
parent-last and your problem may go away.

Jake

On 6/25/2010 12:26 PM, aalok95 wrote:
> 
> Hi Friends,
> 
> Problem:
> I've tried many times to configure apache-log4j-extras-1.0 with
> apache-log4j-1.2.16, but it is still failing to load classes from configure
> apache-log4j-extras-1.0 JAR file.
> 
> What I want to do:
> Actually I want to do time based log rotation the my application specific
> log files. I could able to configure using
(Continue reading)


Gmane