chrisfulstow / log4net.signalr Goto Github PK
View Code? Open in Web Editor NEWLog4Net appender for streaming log events directly to web client using SignalR
Log4Net appender for streaming log events directly to web client using SignalR
You should probably make a note that if you include log4net.SignalR as an assembly (especially when downloading from NuGet) that the appender element should also include the assembly reference as well like this:
<appender name="SignalrAppender" type="log4net.SignalR.SignalrAppender, log4net.SignalR">
Please add functionality to allow a standalone process to communicate logging events to a remote instance of the SignalrAppenderHub. This should be enabled by adding an option to the appender called "ProxyUrl". When not present in the log4net configuration, the default functionality of self hosting the hub would apply. When present, the appender should instantiate a proxy hub, pointing to the URL indicated.
The front page documentation should also be update to reflect these changes.
The problems are here:
$(function() {
var log4net = $.connection.hub;//.signalrAppenderHub;<-------------!!!!
// <------ log4net.client is undef
log4net.client.onLoggedEvent = function(formattedEvent, loggedEvent) {
if (console && console.log)
console.log("onLoggedEvent", formattedEvent, loggedEvent);
var dtm = new Date(Date.parse(loggedEvent.TimeStamp));
var dateCell = $("<td>").css("white-space", "nowrap").text(printValue(dtm));
var levelCell = $("<td>").text(loggedEvent.Level.Name);
var detailsCell = $("<td>").text(loggedEvent.Message);
var row = $("<tr>").append(dateCell, levelCell, detailsCell);
row = row.addClass(convertDebugStyleToBootstrap(loggedEvent.Level.Name.toLowerCase()));
row.bind("click", formattedEvent, showDetails);
$('#log-table tbody').append(row);
};
$.connection.hub.logging = true;
$.connection.hub.start(function() {
log4net.server.listen();
});
I couldn't get this to work in my project so for debugging purposes I copied both the hub and the appender code into my project. However with code below
public SignalrAppenderHub()
{
SignalrAppender.Instance.MessageLogged = OnMessageLogged;
}
SignalrAppender.Instance
is null
Hi,
Im trying to implement the lib but is not generating the hub method
I have signalr on the site working perfect
Hubs get created per each call to the hub. Make sure you only subscribe once.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.