本文整理汇总了C#中DotNetNuke.Services.Log.EventLog.EventLogController.AddLog方法的典型用法代码示例。如果您正苦于以下问题:C# EventLogController.AddLog方法的具体用法?C# EventLogController.AddLog怎么用?C# EventLogController.AddLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Services.Log.EventLog.EventLogController
的用法示例。
在下文中一共展示了EventLogController.AddLog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEmptyBinClick
/// <summary>
/// Permanently removes all deleted tabs and modules
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks>
/// Parent tabs will not be deleted. To delete a parent tab all child tabs need to be deleted before.
/// </remarks>
/// <history>
/// [VMasanas] 18/08/2004 Created
/// </history>
protected void OnEmptyBinClick(Object sender, EventArgs e)
{
var objEventLog = new EventLogController();
foreach (ListItem item in lstModules.Items)
{
var objModules = new ModuleController();
var values = item.Value.Split('-');
var tabId = int.Parse(values[0]);
var moduleId = int.Parse(values[1]);
//delete module
var objModule = objModules.GetModule(moduleId, tabId, false);
if (objModule != null)
{
//hard-delete Tab Module Instance
objModules.DeleteTabModule(tabId, moduleId, false);
objEventLog.AddLog(objModule, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_DELETED);
}
}
foreach (ListItem item in lstTabs.Items)
{
var intTabId = int.Parse(item.Value);
var objTabs = new TabController();
var objTab = objTabs.GetTab(intTabId, PortalId, false);
if (objTab != null)
{
DeleteTab(objTab, true);
}
}
BindData();
}
示例2: AddMessage
private void AddMessage(RoleInfo roleInfo, EventLogController.EventLogType logType)
{
var eventLogController = new EventLogController();
eventLogController.AddLog(roleInfo,
PortalController.GetCurrentPortalSettings(),
UserController.GetCurrentUserInfo().UserID,
"",
logType);
}
示例3: AddAuthentication
/// -----------------------------------------------------------------------------
/// <summary>
/// AddAuthentication adds a new Authentication System to the Data Store.
/// </summary>
/// <param name="authSystem">The new Authentication System to add</param>
/// <history>
/// [cnurse] 07/10/2007 Created
/// </history>
/// -----------------------------------------------------------------------------
public static int AddAuthentication(AuthenticationInfo authSystem)
{
var objEventLog = new EventLogController();
objEventLog.AddLog(authSystem, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.AUTHENTICATION_CREATED);
return provider.AddAuthentication(authSystem.PackageID,
authSystem.AuthenticationType,
authSystem.IsEnabled,
authSystem.SettingsControlSrc,
authSystem.LoginControlSrc,
authSystem.LogoffControlSrc,
UserController.GetCurrentUserInfo().UserID);
}
示例4: SaveLanguagePack
public static void SaveLanguagePack(LanguagePackInfo languagePack)
{
var objEventLog = new EventLogController();
if (languagePack.LanguagePackID == Null.NullInteger)
{
//Add Language Pack
languagePack.LanguagePackID = DataProvider.Instance().AddLanguagePack(languagePack.PackageID,
languagePack.LanguageID,
languagePack.DependentPackageID,
UserController.GetCurrentUserInfo().UserID);
objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LANGUAGEPACK_CREATED);
}
else
{
//Update LanguagePack
DataProvider.Instance().UpdateLanguagePack(languagePack.LanguagePackID,
languagePack.PackageID,
languagePack.LanguageID,
languagePack.DependentPackageID,
UserController.GetCurrentUserInfo().UserID);
objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LANGUAGEPACK_UPDATED);
}
}
示例5: DeleteLanguagePack
public static void DeleteLanguagePack(LanguagePackInfo languagePack)
{
if (languagePack.PackageType == LanguagePackType.Core)
{
Locale language = LocaleController.Instance.GetLocale(languagePack.LanguageID);
if (language != null)
{
Localization.DeleteLanguage(language);
}
}
DataProvider.Instance().DeleteLanguagePack(languagePack.LanguagePackID);
var objEventLog = new EventLogController();
objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LANGUAGEPACK_DELETED);
}
示例6: DeleteLanguagePack
public static void DeleteLanguagePack(LanguagePackInfo languagePack)
{
// fix DNN-26330 Removing a language pack extension removes the language
// we should not delete language when deleting language pack, as there is just a loose relationship
//if (languagePack.PackageType == LanguagePackType.Core)
//{
// Locale language = LocaleController.Instance.GetLocale(languagePack.LanguageID);
// if (language != null)
// {
// Localization.DeleteLanguage(language);
// }
//}
DataProvider.Instance().DeleteLanguagePack(languagePack.LanguagePackID);
var objEventLog = new EventLogController();
objEventLog.AddLog(languagePack, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LANGUAGEPACK_DELETED);
}
示例7: AddSchedule
public static int AddSchedule(string TypeFullName, int TimeLapse, string TimeLapseMeasurement, int RetryTimeLapse, string RetryTimeLapseMeasurement, int RetainHistoryNum, string AttachToEvent,
bool CatchUpEnabled, bool Enabled, string ObjectDependencies, string Servers, string FriendlyName)
{
var objEventLog = new EventLogController();
objEventLog.AddLog("TypeFullName", TypeFullName, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, EventLogController.EventLogType.SCHEDULE_CREATED);
return DataProvider.Instance().AddSchedule(TypeFullName,
TimeLapse,
TimeLapseMeasurement,
RetryTimeLapse,
RetryTimeLapseMeasurement,
RetainHistoryNum,
AttachToEvent,
CatchUpEnabled,
Enabled,
ObjectDependencies,
Servers,
UserController.GetCurrentUserInfo().UserID,
FriendlyName);
}
示例8: GetConfig
public static RewriterConfiguration GetConfig()
{
var config = new RewriterConfiguration {Rules = new RewriterRuleCollection()};
FileStream fileReader = null;
string filePath = "";
try
{
config = (RewriterConfiguration) DataCache.GetCache("RewriterConfig");
if ((config == null))
{
filePath = Common.Utilities.Config.GetPathToFile(Common.Utilities.Config.ConfigFileType.SiteUrls);
//Create a FileStream for the Config file
fileReader = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
var doc = new XPathDocument(fileReader);
config = new RewriterConfiguration {Rules = new RewriterRuleCollection()};
foreach (XPathNavigator nav in doc.CreateNavigator().Select("RewriterConfig/Rules/RewriterRule"))
{
var rule = new RewriterRule {LookFor = nav.SelectSingleNode("LookFor").Value, SendTo = nav.SelectSingleNode("SendTo").Value};
config.Rules.Add(rule);
}
if (File.Exists(filePath))
{
//Set back into Cache
DataCache.SetCache("RewriterConfig", config, new DNNCacheDependency(filePath));
}
}
}
catch (Exception ex)
{
//log it
var objEventLog = new EventLogController();
var objEventLogInfo = new LogInfo();
objEventLogInfo.AddProperty("UrlRewriter.RewriterConfiguration", "GetConfig Failed");
objEventLogInfo.AddProperty("FilePath", filePath);
objEventLogInfo.AddProperty("ExceptionMessage", ex.Message);
objEventLogInfo.LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString();
objEventLog.AddLog(objEventLogInfo);
Logger.Error(objEventLogInfo);
}
finally
{
if (fileReader != null)
{
//Close the Reader
fileReader.Close();
}
}
return config;
}
示例9: AddUserAuthentication
/// -----------------------------------------------------------------------------
/// <summary>
/// AddUserAuthentication adds a new UserAuthentication to the User.
/// </summary>
/// <param name="userID">The new Authentication System to add</param>
/// <param name="authenticationType">The authentication type</param>
/// <param name="authenticationToken">The authentication token</param>
/// <history>
/// [cnurse] 07/12/2007 Created
/// [skydnn] 11/14/2013 DNN-4016
/// </history>
/// -----------------------------------------------------------------------------
public static int AddUserAuthentication(int userID, string authenticationType, string authenticationToken)
{
var objEventLog = new EventLogController();
UserAuthenticationInfo userAuth = GetUserAuthentication(userID);
if (userAuth == null || String.IsNullOrEmpty(userAuth.AuthenticationType))
{
objEventLog.AddLog("userID/authenticationType",
userID + "/" + authenticationType,
PortalController.GetCurrentPortalSettings(),
UserController.GetCurrentUserInfo().UserID,
EventLogController.EventLogType.AUTHENTICATION_USER_CREATED);
return provider.AddUserAuthentication(userID, authenticationType, authenticationToken, UserController.GetCurrentUserInfo().UserID);
}
else
{
objEventLog.AddLog("userID/authenticationType already exists",
userID + "/" + authenticationType,
PortalController.GetCurrentPortalSettings(),
UserController.GetCurrentUserInfo().UserID,
EventLogController.EventLogType.AUTHENTICATION_USER_UPDATED);
return userAuth.UserAuthenticationID;
}
}
示例10: LogModuleProviderExceptionInRequest
/// <summary>
/// logs an exception related to a module provider once per cache-lifetime
/// </summary>
/// <param name="ex"></param>
/// <param name="status"></param>
/// <param name="result"></param>
/// <param name="messages"></param>
/// <param name="provider"></param>
public static void LogModuleProviderExceptionInRequest(Exception ex, string status,
ExtensionUrlProvider provider,
UrlAction result,
List<string> messages)
{
if (ex != null)
{
string moduleProviderName = "Unknown Provider";
string moduleProviderVersion = "Unknown Version";
if (provider != null)
{
moduleProviderName = provider.ProviderConfig.ProviderName;
moduleProviderVersion = provider.GetType().Assembly.GetName(false).Version.ToString();
}
//this logic prevents a site logging an exception for every request made. Instead
//the exception will be logged once for the life of the cache / application restart or 1 hour, whichever is shorter.
//create a cache key for this exception type
string cacheKey = ex.GetType().ToString();
//see if there is an existing object logged for this exception type
object existingEx = DataCache.GetCache(cacheKey);
if (existingEx == null)
{
//if there was no existing object logged for this exception type, this is a new exception
DateTime expire = DateTime.Now.AddHours(1);
DataCache.SetCache(cacheKey, cacheKey, expire);
//just store the cache key - it doesn't really matter
//create a log event
string productVer = Assembly.GetExecutingAssembly().GetName(false).Version.ToString();
var elc = new EventLogController();
var logEntry = new LogInfo {LogTypeKey = "GENERAL_EXCEPTION"};
logEntry.AddProperty("Url Rewriting Extension Url Provider Exception",
"Exception in Url Rewriting Process");
logEntry.AddProperty("Provider Name", moduleProviderName);
logEntry.AddProperty("Provider Version", moduleProviderVersion);
logEntry.AddProperty("Http Status", status);
logEntry.AddProperty("Product Version", productVer);
if (result != null)
{
logEntry.AddProperty("Original Path", result.OriginalPath ?? "null");
logEntry.AddProperty("Raw Url", result.RawUrl ?? "null");
logEntry.AddProperty("Final Url", result.FinalUrl ?? "null");
logEntry.AddProperty("Rewrite Result", !string.IsNullOrEmpty(result.RewritePath)
? result.RewritePath
: "[no rewrite]");
logEntry.AddProperty("Redirect Location", string.IsNullOrEmpty(result.FinalUrl)
? "[no redirect]"
: result.FinalUrl);
logEntry.AddProperty("Action", result.Action.ToString());
logEntry.AddProperty("Reason", result.Reason.ToString());
logEntry.AddProperty("Portal Id", result.PortalId.ToString());
logEntry.AddProperty("Tab Id", result.TabId.ToString());
logEntry.AddProperty("Http Alias", result.PortalAlias != null ? result.PortalAlias.HTTPAlias : "Null");
if (result.DebugMessages != null)
{
int i = 1;
foreach (string debugMessage in result.DebugMessages)
{
string msg = debugMessage;
if (debugMessage == null)
{
msg = "[message was null]";
}
logEntry.AddProperty("Debug Message[result] " + i.ToString(), msg);
i++;
}
}
}
else
{
logEntry.AddProperty("Result", "Result value null");
}
if (messages != null)
{
int i = 1;
foreach (string msg in messages)
{
logEntry.AddProperty("Debug Message[raw] " + i.ToString(), msg);
i++;
}
}
logEntry.AddProperty("Exception Type", ex.GetType().ToString());
logEntry.AddProperty("Message", ex.Message);
logEntry.AddProperty("Stack Trace", ex.StackTrace);
if (ex.InnerException != null)
{
logEntry.AddProperty("Inner Exception Message", ex.InnerException.Message);
logEntry.AddProperty("Inner Exception Stacktrace", ex.InnerException.StackTrace);
}
logEntry.BypassBuffering = true;
elc.AddLog(logEntry);
//.........这里部分代码省略.........
示例11: UpdateSkinPackage
public static void UpdateSkinPackage(SkinPackageInfo skinPackage)
{
DataProvider.Instance().UpdateSkinPackage(skinPackage.SkinPackageID,
skinPackage.PackageID,
skinPackage.PortalID,
skinPackage.SkinName,
skinPackage.SkinType,
UserController.GetCurrentUserInfo().UserID);
var eventLogController = new EventLogController();
eventLogController.AddLog(skinPackage, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.SKINPACKAGE_UPDATED);
foreach (KeyValuePair<int, string> kvp in skinPackage.Skins)
{
UpdateSkin(kvp.Key, kvp.Value);
}
}
示例12: UpdateUserProfile
/// -----------------------------------------------------------------------------
/// <summary>
/// UpdateUserProfile persists a user's Profile to the Data Store
/// </summary>
/// <remarks>
/// </remarks>
/// <param name="user">The user to persist to the Data Store.</param>
/// -----------------------------------------------------------------------------
public override void UpdateUserProfile(UserInfo user)
{
ProfilePropertyDefinitionCollection properties = user.Profile.ProfileProperties;
//Ensure old and new TimeZone properties are in synch
var newTimeZone = properties["PreferredTimeZone"];
var oldTimeZone = properties["TimeZone"];
if (oldTimeZone != null && newTimeZone != null)
{ //preference given to new property, if new is changed then old should be updated as well.
if (newTimeZone.IsDirty && !string.IsNullOrEmpty(newTimeZone.PropertyValue))
{
var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(newTimeZone.PropertyValue);
if (timeZoneInfo != null)
oldTimeZone.PropertyValue = timeZoneInfo.BaseUtcOffset.TotalMinutes.ToString(CultureInfo.InvariantCulture);
}
//however if old is changed, we need to update new as well
else if (oldTimeZone.IsDirty)
{
int oldOffset;
int.TryParse(oldTimeZone.PropertyValue, out oldOffset);
newTimeZone.PropertyValue = Localization.ConvertLegacyTimeZoneOffsetToTimeZoneInfo(oldOffset).Id;
}
}
foreach (ProfilePropertyDefinition profProperty in properties)
{
if ((profProperty.PropertyValue != null) && (profProperty.IsDirty))
{
var objSecurity = new PortalSecurity();
string propertyValue = objSecurity.InputFilter(profProperty.PropertyValue, PortalSecurity.FilterFlag.NoScripting);
_dataProvider.UpdateProfileProperty(Null.NullInteger, user.UserID, profProperty.PropertyDefinitionId,
propertyValue, (int) profProperty.ProfileVisibility.VisibilityMode,
profProperty.ProfileVisibility.ExtendedVisibilityString(), DateTime.Now);
var objEventLog = new EventLogController();
objEventLog.AddLog(user, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", "USERPROFILE_UPDATED");
}
}
}
示例13: AddLog
private void AddLog(string logContent)
{
var objEventLog = new EventLogController();
objEventLog.AddLog("Site Redirection Rule", logContent, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, EventLogController.EventLogType.ADMIN_ALERT);
}
示例14: UserDeleted
/// <summary>
/// UserDeleted runs when the User has been deleted
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// [cnurse] 3/01/2006 created
/// </history>
protected void UserDeleted( object sender, User.UserDeletedEventArgs e )
{
try
{
EventLogController objEventLog = new EventLogController();
objEventLog.AddLog( "Username", e.UserName, PortalSettings, e.UserId, EventLogController.EventLogType.USER_DELETED );
Response.Redirect( Globals.NavigateURL( TabId, "", ( ( Request.QueryString["filter"] != "" ) ? ( "filter=" + Request.QueryString["filter"] ) : "" ).ToString() ), true );
}
catch( Exception exc ) //Module failed to load
{
Exceptions.ProcessModuleLoadException( this, exc );
}
}
示例15: UserCreateCompleted
/// <summary>
/// UserCreateCompleted runs when a new user has been Created
/// </summary>
/// <remarks>
/// </remarks>
/// <history>
/// [cnurse] 3/06/2006 created
/// </history>
protected void UserCreateCompleted( object sender, User.UserCreatedEventArgs e )
{
string strMessage = "";
try
{
if( e.CreateStatus == UserCreateStatus.Success )
{
if( IsRegister )
{
// send notification to portal administrator of new user registration
Mail.SendMail( User, MessageType.UserRegistrationAdmin, PortalSettings );
// complete registration
switch( PortalSettings.UserRegistration )
{
case (int)Globals.PortalRegistrationType.PrivateRegistration:
Mail.SendMail( User, MessageType.UserRegistrationPrivate, PortalSettings );
//show a message that a portal administrator has to verify the user credentials
strMessage = string.Format( Localization.GetString( "PrivateConfirmationMessage", this.LocalResourceFile ), User.Email );
break;
case (int)Globals.PortalRegistrationType.PublicRegistration:
Mail.SendMail( User, MessageType.UserRegistrationPublic, PortalSettings );
UserLoginStatus loginStatus = 0;
UserController.UserLogin( PortalSettings.PortalId, User.Username, User.Membership.Password, "", PortalSettings.PortalName, "", ref loginStatus, false );
break;
case (int)Globals.PortalRegistrationType.VerifiedRegistration:
Mail.SendMail( User, MessageType.UserRegistrationVerified, PortalSettings );
//show a message that an email has been send with the registration details
strMessage = string.Format( Localization.GetString( "VerifiedConfirmationMessage", this.LocalResourceFile ), User.Email );
break;
}
// affiliate
if( ! Null.IsNull( User.AffiliateID ) )
{
AffiliateController objAffiliates = new AffiliateController();
objAffiliates.UpdateAffiliateStats( User.AffiliateID, 0, 1 );
}
//store preferredlocale in cookie
Localization.SetLanguage( User.Profile.PreferredLocale );
AddLocalizedModuleMessage( strMessage, ModuleMessageType.GreenSuccess, ( strMessage.Length > 0 ) );
}
else
{
if( e.Notify )
{
//Send Notification to User
if( PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.VerifiedRegistration )
{
Mail.SendMail( User, MessageType.UserRegistrationVerified, PortalSettings );
}
else
{
Mail.SendMail( User, MessageType.UserRegistrationPublic, PortalSettings );
}
}
}
//Log Event to Event Log
EventLogController objEventLog = new EventLogController();
objEventLog.AddLog( User, PortalSettings, UserId, User.Username, EventLogController.EventLogType.USER_CREATED );
if( IsRegister )
{
//Response.Redirect( RedirectURL, true );
if (string.IsNullOrEmpty(strMessage))
{
Response.Redirect(RedirectURL, true);
}
else
{
DisableForm();
pnlRegister.Visible = false;
}
}
else
{
Response.Redirect( ReturnUrl, true );
}
}
else
//.........这里部分代码省略.........