Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

How to change BitFactory.Logging Default Folder Path?

SmartConnector Forum

Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure Building
  • SmartConnector
  • SmartConnector Forum
  • How to change BitFactory.Logging Default Folder Path?
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
JeffBowman
Sisko JeffBowman Sisko
164
ardak
ardak Schneider Alumni (Retired)
34
sesa180908_brid
Commander sesa180908_brid Commander
34
mike_meirovitz
Commander mike_meirovitz
21
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to SmartConnector Forum
Solved
sesa180961_brid
Lieutenant sesa180961_brid Lieutenant
Lieutenant

Posted: ‎2017-02-27 12:55 PM

0 Likes
6
1852
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 12:55 PM

How to change BitFactory.Logging Default Folder Path?

When using EWS.Client (2.2.108.0) and BitFactory.Logging (1.5.2.0), I see a few options (in the config file) to add path to where the logs will be written to.

An example is:

<compositeLogger name="debugLoggers">

        <rollingDateFileLoggers>

          <rollingDateFileLogger name="debugFileLogger" isInsistent="true" formattedFileName="C:\Schneider Electric\App\Logs\EWS\Debug_{timestamp:MM-dd-yy}.log" />

        </rollingDateFileLoggers>

      </compositeLogger>

But when I run the program, the logs are not being written in the folder specified above. They are always written to the folder where the program executable is located. Is this a default setup?

Is there a way to change this path?

Tags (3)
  • Tags:
  • bitfactory.logging
  • ews
  • ewsclient
Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-28 07:46 AM

0 Likes
4
1800
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 07:46 AM

Jeff is correct.  During 2.1 cyber security review, it was deemed that a configurable log destination folder was a vulnerability.  In that version, we switched from BitFactory.Logging to NLog as the library used in SmartConnector. 

The Logs are always found in the "%PROGRAMDATA%\SmartConnector\Logs" folder.

See Answer In Context

Reply
Replies 6
JeffBowman
Sisko JeffBowman Sisko
Sisko

Posted: ‎2017-02-28 07:38 AM

0 Likes
5
1800
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 07:38 AM

Hi Maneesh,

I think you posted this in the wrong forum, can you move this question to the SmartConnector developer forum?

However, as a quick answer BitFactory.Logging is deprecated anyways and is not used anymore.

-Jeff

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-28 07:46 AM

0 Likes
4
1801
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 07:46 AM

Jeff is correct.  During 2.1 cyber security review, it was deemed that a configurable log destination folder was a vulnerability.  In that version, we switched from BitFactory.Logging to NLog as the library used in SmartConnector. 

The Logs are always found in the "%PROGRAMDATA%\SmartConnector\Logs" folder.

Reply
sesa180961_brid
Lieutenant sesa180961_brid Lieutenant
Lieutenant

Posted: ‎2017-02-28 10:09 AM

0 Likes
1
1800
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 10:09 AM

I am not using SmartConnector in this project. Its only the EwsClient library.

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-28 10:16 AM

0 Likes
0
1800
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 10:16 AM

Same goes for that scenario. 

Reply
sesa180961_brid
Lieutenant sesa180961_brid Lieutenant
Lieutenant

Posted: ‎2017-02-28 10:41 AM

0 Likes
1
1800
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 10:41 AM

Is there a way to log only Error logs instead of info, status, debug and error logs?

The customer does not want all the logs and the file size grows very soon.

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-28 11:08 AM

1 Like
0
1800
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 11:08 AM

The short answer is "Yes".  That said, the coupling between the components of SmartConnector is becoming more the norm than the exception so "buyer beware".  It's advised that you use the framework as designed for future projects.  But here is what you need to do.

Logging in SmartConnector (and by extension EwsClient) is provided by the SxL.Logger Singleton class.  This class wraps up NLog.Logger adding in ambient filtering based on logging level and category.  The logic for filtering is provided by LoggingFilter (another Singleton).  Fortunately, it uses a "Provider" property which is based on the ILoggerFilterProvider interface.  So to take control over what get's logged, you would need to do something like this:

    /// <summary>

        /// Code that runs once when your "app" starts

        /// </summary>

        private void StartUpCode()

        {

            // 1. Set the data directory (here is where you could alter the log destination folder)

            AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "SmartConnector"));

            // 2. Override the default Logging Filter Provider with your own.

            LoggerFilter.Instance.Provider = new CustomLoggingFilterProvider();

            // Use logging as you always would.

            Logger.LogDebug("My Category", "Hello World");

        }

        private class CustomLoggingFilterProvider : ILoggerFilterProvider

        {

            public bool AllowLogging(string category, LoggingLevel level)

            {

                return level >= MaximumLoggingLevel;

            }

            public LoggingLevel MaximumLoggingLevel

            {

                get

                {

                    return LoggingLevel.Error;

                }

            }

            public void Refresh()

            {

                // Intentionally empty

            }

        }

Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of