Giter VIP home page Giter VIP logo

Comments (10)

wwwlicious avatar wwwlicious commented on June 3, 2024

For seq you can download the latest release if you plan to run it on > Windows 7.
The Seq 4.x versions will work on older OS's

from servicestack-seq-requestlogsfeature.

mtsvietukhin avatar mtsvietukhin commented on June 3, 2024

Thanks for the quick response. I have ServiceStack v3.9.71 and installed latest SEQ. tried with multiple versions. I added this line to Host Plugins.Add(new SeqRequestLogsFeature("http://localhost:5341"));

Do I need to do anything else in order this to work?

from servicestack-seq-requestlogsfeature.

wwwlicious avatar wwwlicious commented on June 3, 2024

No that should be all that is required.
The plugin creates json from the requests and sends it to the seq ingestion url both of which haven't had breaking changes since Seq version 3 IIRC.

The seq server should not force SSL if you are using the url above and it should also not require ApiKey's for all logged events. You'll find this in the Seq admin UI.

from servicestack-seq-requestlogsfeature.

mtsvietukhin avatar mtsvietukhin commented on June 3, 2024

I don't have any errors or traffic going to http://localhost:5341 I checked with fiddler. Can I call explicitly into that Logger?

from servicestack-seq-requestlogsfeature.

wwwlicious avatar wwwlicious commented on June 3, 2024

The plugin registers an instance of IRequestLogger in the container.

Using that instance, you can call the Log method directly.

https://github.com/wwwlicious/servicestack-seq-requestlogsfeature/blob/v3/src/ServiceStack.Seq.RequestLogsFeature/SeqRequestLogger.cs#L48

from servicestack-seq-requestlogsfeature.

mtsvietukhin avatar mtsvietukhin commented on June 3, 2024

image

from servicestack-seq-requestlogsfeature.

mtsvietukhin avatar mtsvietukhin commented on June 3, 2024

I debug your code and get to issue with serializing Json before sending to Seq.
"{0}/api/events/raw".Fmt(seqUrl).PostJsonToUrl(
new SeqLogRequest(requestLogEntry),
request => request.Headers.Add("X-Seq-ApiKey", apiKey));

from servicestack-seq-requestlogsfeature.

mtsvietukhin avatar mtsvietukhin commented on June 3, 2024

That was due to our property ServiceStack.Text.JsConfig.EmitCamelCaseNames = true;

from servicestack-seq-requestlogsfeature.

mtsvietukhin avatar mtsvietukhin commented on June 3, 2024

Here is my fix in case you want to update your V3 library:
I have to switch to use https://www.newtonsoft.com/json and HttpClient
instead for ServiceStack.Text.Json
Task.Run(async () =>
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-Seq-ApiKey", apiKey);
var requestBody = JsonConvert.SerializeObject(new { events = new SeqRequestLogEntry[1]{ requestLogEntry } }, new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver()
});
var httpRequestMessage = new HttpRequestMessage(new HttpMethod("POST"), $"{seqUrl}/api/events/raw")
{
Content = new StringContent(requestBody, Encoding.UTF8, "application/json")
};
await client.SendAsync(httpRequestMessage);
});
}

from servicestack-seq-requestlogsfeature.

wwwlicious avatar wwwlicious commented on June 3, 2024

newer versions use JSConfig scopes. v3 doesn't have scopes and that branch is not maintained. Glad you were able to get it working. 👍

https://github.com/wwwlicious/servicestack-seq-requestlogsfeature/blob/master/src/ServiceStack.Seq.RequestLogsFeature/SeqRequestLogger.cs#L35

from servicestack-seq-requestlogsfeature.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.