Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6882647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:16:48+00:00 2026-05-27T05:16:48+00:00

I am able to transform my log4net.config but I am not getting this one.

  • 0

I am able to transform my log4net.config but I am not getting this one. How do I change the following connectionString?

<?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <log4net debug="true">
        <root>
          <level value="ALL" />
        </root> 
        <logger name="MyApp">
          <level value="Debug" />
           <appender-ref ref="RollingLogFileAppender" />
           <appender-ref ref="AdoNetAppender" />
        </logger>
        <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
                <file value="C:\Websites\Logs\SiteLog.txt"/>
                <appendToFile value="true"/>
                <rollingStyle value="Date"/>
                <datePattern value="yyyyMMdd.txt"/>
                <layout type="log4net.Layout.PatternLayout">
                    <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline"/>
                </layout>
            </appender>
        <appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
          <bufferSize value="1" />
          <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
          <connectionString value="***Data Source=(local);initial catalog=MyDB;User ID=sa;Password=dbPassword***" />

The following does not work:

<?xml version="1.0" encoding="utf-8" ?>

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <log4net debug="false" 
           xdt:Transform="SetAttributes(debug)" />
  <appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
    <connectionString value="Data Source=(local);initial catalog=RavenAxiom;User ID=ravenaxiom;Password=xyz" 
            xdt:Transform="SetAttributes(value)" />
  </appender>
</configuration>

It changes the debug value so it partially works. Thank for the help.

Jack

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:16:48+00:00Added an answer on May 27, 2026 at 5:16 am

    Ok, got it working with: xdt:Locator="Match(name)" in appender name="AdoNetAppender" and then xdt:Transform="Replace" in connectionString value="NewConnValues".

    <configuration>
      <log4net>
        <appender name="AdoNetAppender" 
                  type="log4net.Appender.AdoNetAppender" 
                  xdt:Locator="Match(name)">
          <connectionString value="YourConnectionStringToBe"  
                            xdt:Transform="Replace"/>
        </appender>
      </log4net>
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using XSLT, I'd like to be able to transform this : <doc> <tag1>AAA</tag1> Hello
My xslt transform does not pick up my document, this is because some/most elements
I am able to write to a log file using log4net and Cassini/IIS dev
I have a requirement to run a transform on a xml file. it is
I am using xslt to transform an xml document to html for use in
I am trying to use VBScript to do an XSLT transform on an XML
In my C# client application, I use XSLT to transform XML into HTML. I
How can I transform a website to be able to handle multi language (example
I am animating a simple UIView transform and would like to be able to
I'm able to write a horribly bad xslt without using keys but it's quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.