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

SmartConnector log file location

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
  • SmartConnector log file location
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
sesa178151_brid
Crewman sesa178151_brid Crewman
Crewman

Posted: ‎2016-08-30 11:52 AM

0 Likes
3
1047
  • 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.

‎2016-08-30 11:52 AM

SmartConnector log file location

In earlier versions of SC, the user would configure the location of the log files in the Mongoose.Service.exe.config file (or in the app.config file for a developer). Since version 2.1.83, the log file is automatically located in the C:\ProgramData\SmartConnector\Logs folder for the installed windows service.

Where is the log file stored for a developer, or is there some configuration necessary? My processor is writing entries to a log (by calling Logger.LogInfo, Logger.LogError, etc.), but nothing is showing up in the logs in the above folder.

Thanks.

Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2016-08-31 06:26 AM

1 Like
2
988
  • 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.

‎2016-08-31 06:26 AM

You are correct. Prior to the 2.1 release, the logging framework used in SmartConnector was highly configurable via the app.config file for the service executable.  During the extensive cyber-security testing which SmartConnector underwent prior to the 2.1 release, it was determined that this highly configurable approach was a potential security vulnerability.  As a result, we decided to limit the amount of configuration customization available to the end user and control configuration programmatically.  One of these limitations was to force logging to a single location where access could be secured using Windows security policies. 

Under the covers SxL.Common.Logger class uses a singleton pattern where the actual log writer class is lazily instantiated the first time it is needed.  This lazy instantiation is when configuration mentioned above occurs. One of the configuration steps is to set the target location.  This is done based on the value of the runtime AppDomain.CurrentDomain.GetData("DataDirectory") value.  Since SxL.Common is a very low level assembly, it has no “app” knowledge so it assumes that something has already set this.  If nothing has (like in your case) the value is null and no logging occurs.

During normal SmartConnector service runtime this is obviously handled for you.  However in a Unit Test environment you do need to intercede and set this manually.  The easiest way to accomplish this, is to create a reference to the Mongoose.Service.exe from your Unit Test assembly and then call Mongoose.InitDataDirectory() in your FixtureStartup method (similar to calling InitIoC for database access).

Additionally, there is a NuGet package available for unit testing of Processor extensions.  If you install the Mongoose.Process.Test NuGet and add the IMongooseFixture interface to any Unit Test fixture class you will have access to several extension methods for running unit tests.  One of these is EnsureLoggingEnabled.   This method will call InitDataDirectory and ensure that a “Testing” LogCategory is present and enabled for logging.  This way, you can log “Testing” entries which wouldn’t affect production code.  These can be in your production Processor itself or in the Unit Test fixture or both.

If you use the above methods, the log files will always be located in %SYSTEMDRIVE%\ProgramData\SmartConnector\Logs.

See Answer In Context

Reply
Replies 3
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2016-08-31 06:26 AM

1 Like
2
989
  • 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.

‎2016-08-31 06:26 AM

You are correct. Prior to the 2.1 release, the logging framework used in SmartConnector was highly configurable via the app.config file for the service executable.  During the extensive cyber-security testing which SmartConnector underwent prior to the 2.1 release, it was determined that this highly configurable approach was a potential security vulnerability.  As a result, we decided to limit the amount of configuration customization available to the end user and control configuration programmatically.  One of these limitations was to force logging to a single location where access could be secured using Windows security policies. 

Under the covers SxL.Common.Logger class uses a singleton pattern where the actual log writer class is lazily instantiated the first time it is needed.  This lazy instantiation is when configuration mentioned above occurs. One of the configuration steps is to set the target location.  This is done based on the value of the runtime AppDomain.CurrentDomain.GetData("DataDirectory") value.  Since SxL.Common is a very low level assembly, it has no “app” knowledge so it assumes that something has already set this.  If nothing has (like in your case) the value is null and no logging occurs.

During normal SmartConnector service runtime this is obviously handled for you.  However in a Unit Test environment you do need to intercede and set this manually.  The easiest way to accomplish this, is to create a reference to the Mongoose.Service.exe from your Unit Test assembly and then call Mongoose.InitDataDirectory() in your FixtureStartup method (similar to calling InitIoC for database access).

Additionally, there is a NuGet package available for unit testing of Processor extensions.  If you install the Mongoose.Process.Test NuGet and add the IMongooseFixture interface to any Unit Test fixture class you will have access to several extension methods for running unit tests.  One of these is EnsureLoggingEnabled.   This method will call InitDataDirectory and ensure that a “Testing” LogCategory is present and enabled for logging.  This way, you can log “Testing” entries which wouldn’t affect production code.  These can be in your production Processor itself or in the Unit Test fixture or both.

If you use the above methods, the log files will always be located in %SYSTEMDRIVE%\ProgramData\SmartConnector\Logs.

Reply
sesa178151_brid
Crewman sesa178151_brid Crewman
Crewman

Posted: ‎2016-08-31 07:13 AM

0 Likes
1
988
  • 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.

‎2016-08-31 07:13 AM

Thanks. I was able to get logging to work by explicitly calling the InitDataDirectory method in the FixtureStartup method as you indicated. The full call was Mongoose.Service.Mongoose.InitDataDirectory.

But I wasn't able to get the NuGet option to work. I believe that the IMongooseFixture interface and extension methods are in the Mongoose.Test project, not the Mongoose.Process.Test project. So, they're not available via NuGet.

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2016-08-31 07:17 AM

0 Likes
0
987
  • 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.

‎2016-08-31 07:17 AM

You're correct about IMongooseFixture not being available.  I'll look into moving those extension methods into the public NuGet so the would be available to everyone.  I think there is value there for the developer community at large.

Thanks for the feedback.

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