Leo,
You you supply some extra information:
- Are you configuring logging on every request, or just once on startup?
- If you cause an error via the proxy and one not via the proxy on the
same run do you get the same behaviour?
- Would you, in your code, try to access the COMPUTERNAME environment
variable in both these cases and see if it is set as you would expect.
Niall Daley
On Mon, 14 Mar 2005, Hart, Leo wrote:
> Here's something I've come across that maybe someone else has seen:
>
> I've set up a RollingFileAppender:
>
> <appender name="SMTP - Leo"
> type="log4net.Appender.SMTPAppender">
> <param name="To" value="[EMAIL PROTECTED]" />
> <param name="From" value="[EMAIL PROTECTED]" />
> <param name="Subject" value="${COMPUTERNAME} SHARES Exception -
> Log4Net Generated" />
> <param name="SMTPHost" value="mailserver.mycompany.com" />
> <param name="LocationInfo" value="false" />
> <param name="BufferSize" value="1024" />
> <param name="Lossy" value="true" />
> <evaluator type="log4net.spi.LevelEvaluator">
> <param name="Threshold" value="ERROR"/>
> </evaluator>
> <layout type="log4net.Layout.PatternLayout">
> <param name="ConversionPattern" value="%-5p | %d{yyyy-MM-dd
> HH:mm:ss, fff} | %t | %X{vendorCode} | %X{adminID} | %X{sessionID} | %c
> | %m%n" />
> </layout>
> </appender>
>
> To email me whenever an exception occurs in my application. You'll
> notice I'm using the COMPUTERNAME environment variable in the subject
> line. Whenever I hit the website directly, bypassing our proxy server
> and cause an error, I receive an email with the subject I expect:
>
> SERVERNAME SHARES Exception - Log4Net Generated
>
> However, if I go through our proxy server and create an error, I receive
> an email with the following subject:
>
> SHARES Exception - Log4Net Generated
>
> So it would appear the COMPUTERNAME server variable is not being
> recognized. Does anyone have any idea why this would occur? I've
> noticed this behavior in all of our environments, QA, UAT and PRD. I've
> ensured that all of the servers on each environment are configured the
> same way.
>
> Thanks,
> Leo Hart
>
>
--
Niall Daley
Log4net Dev