Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this page, it is described how to add teh project theproject to your sollution solution and how to use the functionality in it.

Adding the project to your

...

solution

To use the project functionality, you need to first add the library to your sollutionsolution
It is done in Visual Studio by following those steps:

  1. Right click the sollution solution explorer on the top level sollutionsolution
  2. Choose Add→Existing project
  3. Navigate to EGU.PartnerPortal.Shared project
  4. Double click the csproj file
  5. Now add teh the project reference inside your project
  6. Right click the sollution solution explorer in Dependencies→Projects→Add Project Reference
  7. Add a tag in teh shared project:

...

The value should be a string stating one of the two values:

  • TRUE
    The logger will cretae create a log entry
  • FALSE
    The logger will not cretae create any logs at all

Code

The Logging functionality can be accessed from the static class simply called Log.cs. 

Before being able to log through the project you need to initialize the logger. (Should always be done when your aåplication application starts up, and is only done ones) 

...

Code Block
firstline1
titleLogger initialization
linenumberstrue
string invoker = "IntegrationApi"; 									    /*The name of the application usinusing the log*/
string environmentVariableToggle = "INTEGRATIONAPI_LOGSTATE";			/*The environment variable name on the hosting of the invoking application*/
string appInsightsKey = "InstrumentationKey=xxxx";						/*The app insight key. This can be found in the appinsight application on the hosting environment*/

Log.Initialize(invoker, environmentVariableToggle, appInsightsKey); 	/*Initializing the logger, making it ready for use*/
Log.LogInfo("Integration api started.");								
Log.LogInfo("Logger running");											

...

  • Add a top level folder under the 'DTO' folder
  • Name the sub folder a describtive descriptive thing according to where the DTOs are used
  • Put the DTOs in the folder

...