Hello all,Hope this is an easy stuff to solve due to a newbies misconfig step or something.
lemme introduce better my problem i'm developing a 2-tier app. tier 1 : Web Site tier 2: Data Access Layer i have the log4net config part on the web.config it self. here it is : ================================================================================ <configuration> ... <configSections><section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections> .... <log4net><appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="..\logs\log-file.txt" />
<appendToFile value="true" />
<datePattern value="yyyyMMdd" />
<rollingStyle value="Date" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %d %5rms %-22.22c{1}
%-18.18M - %m%n" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="RollingLogFileAppender" />
</root>
</log4net>
...
<configuration>
================================================================================
as well as the entry at global asax
================================================================================
void Application_Start(object sender, EventArgs e)
{
log4net.Config.XmlConfigurator.Configure();
}
================================================================================
with this done i can perfectly log from the Tier 1(Web Site) here is an
example:
================================================================================
public partial class UsersList : System.Web.UI.Page
{
....
ILog log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
....
log.Debug("Calling userDAO.GetAllUsers()");
....
}
================================================================================
but when i try logging on the Tier 2, doesn't do anything at all, not
even an error.
================================================================================
public partial class userDAO : DAObase
{
private static readonly ILog log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
.....
public DataTable GetAllUsers(out string ErrMsg)
{
ErrMsg = String.Empty;
cmd.CommandText = _queryGetAllUsers;
log.Debug(MethodBase.GetCurrentMethod().Name + ":" +
"Connecting to DB");
cmd.Connection = conn.GetConn();
.....
}
......
}
================================================================================
--
::::: Now Playing: (Winamp is not active ;-)
João Felipe Santoro Pinto<[EMAIL PROTECTED]>
For more Info check my vCard attached
begin:vcard fn;quoted-printable:Jo=C3=A3o Felipe Santoro Pinto n;quoted-printable:Pinto;Jo=C3=A3o Felipe email;internet:[EMAIL PROTECTED] tel;home:+55-21-22327100 tel;cell:+55-21-88510111 x-mozilla-html:FALSE version:2.1 end:vcard
smime.p7s
Description: S/MIME Cryptographic Signature
