1. Did you see this:
http://stackoverflow.com/questions/3659271/log4net-logging-out-the-exception-stacktrace-only-for-certain-files/3660529#3660529
?
It seems to have a configuration solution for your problem.

2. I used extension methods to enhance a logging system a bit. No need to
create a new implementation of ILog.

Ronen.


On Mon, Feb 9, 2015 at 3:53 AM, emacslisp <wudi850...@hotmail.com> wrote:

> By default, log4net will log Stack Trace.
>
> I create a wraper which inherit from "ILog" and implement "ILog" interface
> directly.
>
> public class MyLogger : ILog
> {
>     ...
>     Error(object message, Exception exception)
>     {
>         log.Error(exception.Message);//Now it will show message only.
>     }
>     ...
> }
>
> then log4net.ILog log = new
> MyLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
>
> it could work.
>
> However, I want to config log4net without logging stack trace.
>
> but I could not find any useful information.
>
>
>
> --
> View this message in context:
> http://apache-logging.6191.n7.nabble.com/how-to-make-log4net-exclude-Stack-Trace-tp53708.html
> Sent from the Log4net - Users mailing list archive at Nabble.com.
>



-- 



[image: email_sig] <http://www.magicsoftware.com/>
*Ronen Mashal*
*Software Engineer *| Magic Software Enterprises Ltd.

Tel. +972-3-5389215       |       Fax. +972-3-5389333
rmas...@magicsoftware.com | www.magicsoftware.com
<http://www.magicsoftware.com/?utm_source=email> | [image: Facebook]
<http://www.facebook.com/MagicSoftwareEnterprises>[image: Twitter]
<http://twitter.com/#%21/MagicSoftware>[image: Linkedin]
<http://www.linkedin.com/e/gis/130018/09F34B270EFF>[image: YouTube]
<http://www.youtube.com/MagicSoftware>[image: Google+]
<https://plus.google.com/108972177316548101047/posts>[image: Magic Software
Blog] <http://blog.magicsoftware.com/>





DISCLAIMER. Information in this message and its attachments may be
privileged or confidential. It is for the exclusive use of the intended
recipient(s).
If you are not one of the intended recipients, you are hereby informed that
any use, disclosure, distribution, and/or copying of this information is
strictly prohibited.
If you receive this message in error, please notify the sender immediately
and delete all copies of this message. We recommend that you scan your
incoming Emails.
We cannot accept responsibility for any transmitted viruses.

Reply via email to