Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to log to the DNN EventLog #13

Open
jeremy-farrance opened this issue Sep 27, 2024 · 1 comment
Open

Add ability to log to the DNN EventLog #13

jeremy-farrance opened this issue Sep 27, 2024 · 1 comment

Comments

@jeremy-farrance
Copy link
Owner

Some things needed or wanted:

  • Ability to easily set common LogTypes (ADMIN_ALERT, DEBUG_INFO, etc)
    • and have them show via IntelliSense?
  • Can we get the log controller thru DI (its registered in Startup.cs)?
  • other?
@jeremy-farrance
Copy link
Owner Author

jeremy-farrance commented Sep 28, 2024

My quick experiment (in FCTRL2024 2sxc/Content/Accu/Heading__Basic.cshtml

@using DotNetNuke.Abstractions.Logging
@using DotNetNuke.Services.Log.EventLog

@{
  // Log an event - keep is simple, just Name, Value, and Type
  var dnnLogger = GetService<IEventLogger>();  // the 2sxc way to get the DNN logger
  dnnLogger.AddLog("2sxc / Content App", "Heading__Basic.cshtml", EventLogType.ADMIN_ALERT);
}

The above works in 2sxc, what does the same thing look like in a .ascx (skin) file?

How do we want this to work in Accu something.cs? And, what is the right interface?

// important: used named params and default EventLogType to ??
Accu.Dnn.Log(type: EventLogType.ADMIN_ALERT, 
  name: "2sxc / Content App", 
  value: "Heading__Basic.cshtml"
); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant