Sei sulla pagina 1di 6

CUBELOGIC LIMITED

Workflow Custom C# Function Error Handling


Guide 1.0

www.cubelogic.com
Workflow Custom C# Function Guide

History

Version Date Author Comments


1.0 12th June 2017 Charles Initial Release

Copyright © 2017, All rights reserved.


This material includes the confidential and/or proprietary information of CubeLogic, is for the sole use of the intended
recipient, and may be subject to the terms and conditions of a license agreement. Without the express written consent
of CubeLogic and except as specifically authorized pursuant to a license agreement, no part of this material may be
reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or
facsimile, for any purpose other than for the recipient’s internal use.

Disclaimer
CubeLogic does not warrant, guarantee, or make representations concerning the contents of this material. All
information is provided "AS-IS," without express or implied warranties of any kind including, without limitation, the
warranties of merchantability, fitness for a particular purpose, quality and title. CubeLogic reserves the right to change
the contents of this material and the features or functionalities of its products and services at any time without obligation
to notify anyone of such changes

Copyright  CubeLogic 2017 http://www.Cubelogic.com 2


Workflow Custom C# Function Guide

Table of Contents
1.0 CubeLogic References for Error Handling ................................................................................................................ 4
2.0 Logging the Information/Error into the Windows Event Viewer............................................................................. 5
3.0 Logging the Information/Error into the Database ................................................................................................... 6
4.0 Prerequisites ............................................................................................................................................................ 6

Copyright  CubeLogic 2017 http://www.Cubelogic.com 3


Workflow Custom C# Function Guide

1.0 CubeLogic References for Error Handling


CubeLogic provides two dynamic link libraries for error handling and logging the information.

1. CubeLogic.dll
This library provides functions to log the information/Error into Windows Event Viewer.

2. RiskCubeDataStore.dll
This library will be used to connect to the CubeDataMart to save the logging information to the SQL server
Database.

Above DLLs are placed in the CubeLogic portal installed path.


Ex. C:\inetpub\wwwroot\RCPortal531\bin
We have to refer these DLLs in the project to Use the functions to log the information.

Copyright  CubeLogic 2017 http://www.Cubelogic.com 4


Workflow Custom C# Function Guide

2.0 Logging the Information/Error into the Windows Event Viewer


There are two Static functions which we can call from the code to log the information into the CubeLogic Event
Viewer.
Name Parameter Return
1 Write System. Exception Void
2 Write Void
String , System.Diagnostics.EventLogEntryType

We have to call these function(s) explicitly to log the error or information.

Example:
CubeLogic.Diagnostic.EventLogger.Write(oException);

CubeLogic.Diagnostic.EventLogger.Write("Processing PDC related


Partitions",System.Diagnostics.EventLogEntryType.Information);

Copyright  CubeLogic 2017 http://www.Cubelogic.com 5


Workflow Custom C# Function Guide

3.0 Logging the Information/Error into the Database


Create instance of ‘RiskCube.DataStore.CubeDataMartEntities’ any time before function
‘CubeLogic.Diagnostic.EventLogger.Write’ is called.

Example:
RiskCube.DataStore.CubeDataMartEntities oCDM = new CubeDataMartEntities();

4.0 Prerequisites
Kindly check the below mentioned prerequisites before implementing Information/Error Handling

1) Web.Config file.
<configuration>
<configSections>
<section name="Diagnostic" type="CubeLogic.Diagnostic.Configuration, CubeLogic" requirePermission="false"
allowDefinition="Everywhere"/>
</configSections>
<Diagnostic Source="RCPortal" Log="CubeLogic Event Log" LogErrorInDB="True" LogExtendedTrace="False"/>
</configuration>

2) CubeLogic Event Log Setting in Windows Event Viewer.

3) Add reference .Net DLL ‘System.Data.Entity’ in your project.

Copyright  CubeLogic 2017 http://www.Cubelogic.com 6

Potrebbero piacerti anche