Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SteamTarget breaks NLog #765

Closed
xoxfaby opened this issue Mar 17, 2018 · 2 comments
Closed

SteamTarget breaks NLog #765

xoxfaby opened this issue Mar 17, 2018 · 2 comments
Labels
🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list. 💥 Regression Issues marked with this label are regressions - bugs that were introduced recently.

Comments

@xoxfaby
Copy link

xoxfaby commented Mar 17, 2018

Bug

Description

Trying to use a SteamTarget with NLog breaks logging entirely. Works fine without the SteamTarget, once added, all logging breaks.

Expected behavior

Logs

Actual behavior

No logging at all, just login prompts come up, 0 logging before or after

Steps to reproduce

Add any SteamTarget to the declared targets

Info here

no log provided cause it doesn't log when bugged and logs fine when without the target
no json files cause they all work fine without the SteamTarget, botName is a bot that works fine.

Additional info

NLog.config

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <targets>
    <target xsi:type="ColoredConsole" name="ColoredConsole" detectConsoleAvailable="false" layout="${date:format=yyyy-MM-dd HH\:mm\:ss}|${processname}-${processid}|${level:uppercase=true}|${logger}|${message}${onexception:inner= ${exception:format=toString,Data}}" />
    <target xsi:type="File" name="File" deleteOldFileOnStartup="true" fileName="log.txt" layout="${date:format=yyyy-MM-dd HH\:mm\:ss}|${processname}-${processid}|${level:uppercase=true}|${logger}|${message}${onexception:inner= ${exception:format=toString,Data}}" />
    <!-- Below becomes active when ASF is started with server parameter -->
    <!-- <target type="History" name="History" layout="${date:format=yyyy-MM-dd HH\:mm\:ss}|${processname}-${processid}|${level:uppercase=true}|${logger}|${message}${onexception:inner= ${exception:format=toString,Data}}" maxCount="20" /> -->
    <target xsi:type="File" name="CFile" deleteOldFileOnStartup="false" fileName="clog.txt" layout="${date:format=yyyy-MM-dd HH\:mm\:ss}|${processname}-${processid}|${level:uppercase=true}|${logger}|${message}${onexception:inner= ${exception:format=toString,Data}}" />
    <target type="Steam" name="Steam" steamID="76561198025825383" botName="bot1" />
  </targets>

  <rules>
    <logger name="*" minlevel="Trace" writeTo="File" />
    <logger name="*" minlevel="Debug" writeTo="ColoredConsole" />
    <logger name="*" minlevel="Warn" writeTo="Steam" />

    <!-- Below becomes active when ASF is started with server parameter -->
    <!-- <logger name="*" minlevel="Debug" writeTo="History" /> -->
  </rules>
</nlog>
@xoxfaby
Copy link
Author

xoxfaby commented Mar 17, 2018

FYI in the process of debugging and trying to fix this, I started with a long config that used to work on an older version ASF, but started cutting out targets one by one, removed formatting etc, logging doesn't work until the SteamTarget is removed from the config.

@JustArchi JustArchi added 🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list. 💥 Regression Issues marked with this label are regressions - bugs that were introduced recently. labels Mar 17, 2018
@JustArchi
Copy link
Member

2018-03-17 13:42:19.0765 Error Parsing configuration from C:\Users\Archi\Desktop\ASF-win-x64 (1)\NLog.config failed. Exception: NLog.NLogConfigurationException: Exception when parsing C:\Users\Archi\Desktop\ASF-win-x64 (1)\NLog.config.  ---> NLog.NLogConfigurationException: Cannot access the constructor of type: ArchiSteamFarm.SteamTarget. Is the required permission granted?
   at NLog.Internal.FactoryHelper.CreateInstance(Type t)
   at NLog.Config.Factory`2.TryCreateInstance(String itemName, TBaseType& result)
   at NLog.Config.Factory`2.CreateInstance(String name)
   at NLog.Config.XmlLoggingConfiguration.ParseTargetsElement(NLogXmlElement targetsElement)
   at NLog.Config.XmlLoggingConfiguration.ParseNLogElement(NLogXmlElement nlogElement, String filePath, Boolean autoReloadDefault)
   at NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors)
   --- End of inner exception stack trace ---

Looks like 9e88617 regression, thanks for report.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 Bug Issues marked with this label indicate unintended program behaviour that needs correction. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developers. 🟢 Low priority Issues marked with this label are actively being worked on if nothing serious is on the list. 💥 Regression Issues marked with this label are regressions - bugs that were introduced recently.
Projects
None yet
Development

No branches or pull requests

2 participants