Skip to content

NLog.NLogConfigurationException: BufferingTargetWrapper(Name=mailbuffer): No wrapped Target configured. #6050

@virtualdreams

Description

@virtualdreams

Hi! Thanks for reporting this bug!

Please keep / fill in the relevant info from this template so that we can help you as best as possible.

NLog version: 6.0.6

Platform: .NET10/Windows

Current NLog config (xml or C#, if relevant)

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xsi:schemaLocation="NLog NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      internalLogLevel="Error"
      internalLogFile="logs\internal.log">

  <!-- the targets to write to -->
  <targets>
    <!-- write logs to file -->
    <target xsi:type="File" name="file" maxArchiveFiles="7" fileName="logs\newsticker-cli-${shortdate}.log" layout="${longdate} ${pad:padding=-5:inner=${uppercase:${level}}} ${message} ${exception}" />

    <!-- write logs to console -->
    <target xsi:type="Console" name="console" layout="${pad:padding=-5:inner=${uppercase:${level}}} ${message} ${exception}" />

    <!-- mail -->
    <target xsi:type="BufferingWrapper" name="mailbuffer" slidingTimeout="false" bufferSize="10000" flushTimeout="-1">
      <target xsi:type="Mail" name="mail" 
          smtpServer="example.org"
          smtpPort="25"
          enableSsl="true"
          smtpAuthentication="Basic"
          smtpUserName="username"
          smtpPassword="password"
          from="example@example.org"
          to="example@example.org"
          addNewLines="true"
          subject="newsticker-cli ${mdc:item=newsticker-verb} - ${longdate} - ${machinename}"
          layout="${longdate} ${pad:padding=-5:inner=${uppercase:${level}}} ${message} ${exception}"
        />
      </target>
  </targets>

  <!-- rules to map from logger name to target -->
  <rules>
    <logger name="*" minlevel="Info" writeTo="console, file, mailbuffer" />
  </rules>
</nlog>
  • What is the current result?

Emails are no longer being sent due to the error. Worked perfectly in 5.4.

  • What is the expected result?

Sending mails.

NLog.NLogConfigurationException: BufferingTargetWrapper(Name=mailbuffer): No wrapped Target configured.
  • Please post full exception details (message, stacktrace, inner exceptions)
  • Are there any workarounds? no, just downgrade
  • Is there a version in which it did work? 5.4
  • Can you help us by writing an unit test?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions