Base solution for your next web application
Open Closed

Logging not enabled by default in Core NG template #2998


User avatar
0
jhoiby created

I'm trying to at least get a Facebook login to work in a default ABP template, but I am getting general error messages in the browser UI after clicking the Facebook button. When I search my entire project folder I'm not finding any file named "logs.txt", even though that is the filename specified in log4net.config.

What else do I need to do to enable logging in the Core Angular template? The documentation says logging should be enabled by default.

Thank you,

James


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Normally it should be placed in your *.Web.Host project's bin folder, can you check it ?

    Thanks.

  • User Avatar
    0
    jhoiby created

    The only thing in the bin folder is the debug folder. I've checked for hidden files and I've confirmed that it's not there.

    I also gave "everyone" read/write access to the full *.Web.Host tree and still no log.

    What does it take for a log file to be generated? All I'm doing to test it is starting the site in Visual Studio 2017 and logging on/off with the admin/123qwe account. Is this enough to generate a logging event?

    Is there a way to increase log verbosity?

    Here's my (unmodified default) log4net configuration.

    <?xml version="1.0" encoding="utf-8" ?>
    <log4net>
      <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender" >
        <file value="Logs/Logs.txt" />
        <encoding value="utf-8" />
        <appendToFile value="true" />
        <rollingStyle value="Size" />
        <maxSizeRollBackups value="10" />
        <maximumFileSize value="10000KB" />
        <staticLogFileName value="true" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%-5level %date [%-5.5thread] %-40.40logger - %message%newline" />
        </layout>
      </appender>
      <root>
        <appender-ref ref="RollingFileAppender" />
        <level value="DEBUG" />
      </root>
    </log4net>
    

    Thank you!

    James

  • User Avatar
    0
    jhoiby created

    Additional info: I have been going through the Log4Net and ABP docs to see if I'm missing anything and I did put in some debug code of my own in the debug controller to make sure messages are being generated (breakpoints show the debugging methods are getting hit). Still I'm not seeing any debug logs.txt files. I'm wondering if there are any common issue others have found?

  • User Avatar
    0
    jhoiby created

    I got it working.

    I ended up downloading a new template this evening and it worked first try.

    Sorry I'm such a pain but thank you for this huge framework you've put together. Eventually I'll get it working with Azure AD OpenIDConnect!

    James

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @jhoiby,

    Thanks for your feedback :).