Link to home
Start Free TrialLog in
Avatar of loywm88
loywm88

asked on

Consume .NET DLL using classic ASP

hi,  i have build a DLL using Dot.NET 2.0  .  
i have successfully register the DLL using the regasm command.
And i am able to use my classic ASP page to create the server object and call a test method to return a value.
I am using the  Log4Net  component in my .NET DLL.  
When i  call my ASP script to call the DLL method to do logging,  the log file is not created.
However, when i use a client application to call the method,  the log file is successfully created at C:/Logs/TestLibLog.log.
For the client application, there is a config file ,   Test.vshost.exe.config  , as attached below.

Now,  my question is,  how do i handle the config file for the classic ASP page ?
Do i create a web.config file?

Please let me

thanks
Roy



<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <!-- ConfigSections ============================================= -->
  <configSections>
    <sectionGroup name="spring">
      <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
    </sectionGroup>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
  </configSections>
 
 
  <!-- Log 4 Net ================================================== -->
  <log4net>
    <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
      <file value="C:/Logs/TestLibLog.log"/>
      <appendToFile value="true"/>
      <maximumFileSize value="5000KB"/>
      <maxSizeRollBackups value="5"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %level %thread %logger - %message%newline"/>
      </layout>
      <filter type="log4net.Filter.LevelMatchFilter">
        <levelToMatch value="DEBUG"/>
      </filter>
    </appender>
    <appender name="EventLog" type="log4net.Appender.RollingFileAppender">
      <file value="C:/Projects/Logs/EventLog.log"/>
      <appendToFile value="true"/>
      <maximumFileSize value="5000KB"/>
      <maxSizeRollBackups value="20"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%logger - %message%newline"/>
      </layout>
      <filter type="log4net.Filter.StringMatchFilter">
        <stringToMatch value="Msg:"/>
      </filter>
      <filter type="log4net.Filter.DenyAllFilter"/>
    </appender>
    <appender name="SecurityAppender" type="log4net.Appender.RollingFileAppender">
      <file value="C:/Projects/Logs/Security.log"/>
      <appendToFile value="true"/>
      <maximumFileSize value="5000KB"/>
      <maxSizeRollBackups value="5"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%-date [%P{log4net:HostName}] [%thread] %5level %logger - %message%newline"/>
      </layout>
      <filter type="log4net.Filter.StringMatchFilter">
        <stringToMatch value="Security Violation"/>
      </filter>
      <filter type="log4net.Filter.DenyAllFilter"/>
    </appender>
    <root>
      <!--DEBUG OR INFO OR ERROR OR WARN OR ALL-->
      <level value="DEBUG"/>
      <appender-ref ref="RollingFile"/>
      <appender-ref ref="EventLog"/>
      <appender-ref ref="SecurityAppender"/>
    </root>
  </log4net>
</configuration>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mortaza Doulaty
Mortaza Doulaty
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial