Last active
October 13, 2015 09:08
-
-
Save Dillie-O/4172612 to your computer and use it in GitHub Desktop.
Log4Net ClientLog JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LogEvent(level, message) | |
{ | |
// Default to WARN level if level is not specified. Since we | |
// are not dependent upon the result of the logging, we leave | |
// the data return function empty. | |
level = level || "Warn"; | |
$.ajax({ | |
url: "/ClientLog/Log" + level + "Event", | |
type: "POST", | |
data: { message: message }, | |
success: function (result) { } | |
}); | |
} | |
function LogDebug(message) | |
{ | |
LogEvent("Debug", message); | |
} | |
function LogInfo(message) | |
{ | |
LogEvent("Info", message); | |
} | |
function LogWarn(message) | |
{ | |
LogEvent("Warn", message); | |
} | |
function LogError(message) | |
{ | |
LogEvent("Error", message); | |
} | |
function LogFatal(message) | |
{ | |
LogEvent("Fatal", message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment