WCF XML & JSON support using a single OperationContract method?

I was trying to work on the following requirement for days. I would like my WCF API to handle XML and JSON requests/responses using a single method. I also know that .net 4 supports...

Web Api Model Binding and Polymorphic Inheritance

I am asking if anyone knows if it is possible to to pass into a Web Api a concrete class that inherits from a abstract class. For example: public abstract class A { A(); } public class B :...

Monitor visual studio http request with fiddler

I am trying to monitor the following request from VS2012 on fiddler but can't: var client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:8081/"); var...

Set default WebAPI formatter

We are using WebAPI to mimic the handling of a legacy system. As a result, we would like the default response formatter to be the XmlFormatter and not the JsonFormatter. The reason is that some...

Swashbuckle 5 can't find my ApiControllers

I'm at a point where I really need API documentation for my WebAPI 2 project, and I used the Swashbuckle 5 NuGet package. Out of the box, I can hit {myrooturl}/swagger and a UI pops up, but there...

Asp.Net Web Api is not working in Godaddy server but its working fine in local

I am getting error when i run Web Api (www.example.com/api/values) in godaddy server it shows (404 Not Found The requested document was not found on this server.). But its working fine in local. I...

Using the HttpClient how can I view the request content body?

I'd like to see what the request body of my HTTP request contained for debugging purposes. Here's what I've got right now: var httpResponseMessage = await _httpClient.PostAsync(uri,...

How to change laravel logs format?

I need change the format of laravel logs to json format like this: { "time":"2015-10-06 15:45:36", "host":"192.000.000", "protocol”:”http, tcp", "remote-addrress": "192.000.001", ...

Logback JsonLayout printing all logs on the same line

I am using JsonLayout with Spring Boot to log messages in JSON format. I only want the log messages to be logged to the console and not to a log file. I notice that the JSON logs are logged...

Configuring Serilog RollingFile with appsettings.json

I'm trying to configure Serilog for a .NET Core project. Here's what I have in my appsettings.json: "Serilog": { "MinimumLevel": "Verbose", "Enrich": ["FromLogContext",...

Setting json formatter in monolog

How can the logs be set to json format in monolog.... $logger = new StreamHandler(__DIR__.'/my_app.log'); $logger->setFormatter( new JsonFormatter() ); $logger->pushHandler($logger); This...

Jira REST API returns Bad Request

I am trying to create an issue in jira using the following code. I had run this code and it was working fine earlier. But now, It returns bad request,Please help. Thanks. class Program { ...

Add customized JSON Formmter in appsettings.json

I created a customized JSON Formatter which extends ITextFormatter And try to add it to appsetting.json like this: "WriteTo": [ { "Name": "Console", "Args": { "formatter":...

How we can generate html report in cucumber latest version(3.2.0) with protractor-cucumber framework

Since cucumber 3 removed the registerHandler and registerListener , how we can generate html report in cucumber 3.2.0.I have used below code for generating json report in cucumber...

Is there a way to get beautified log entry using Monolog?

Now my code looks like this: use Monolog\Logger; use Monolog\Handler\StreamHandler; $ipAddress = GeoIp\Manager::getRealIp(); $geoResult = GeoIp\Manager::getDataResult($ipAddress, 'ru'); $logger...

Temporary logging suppression for a scope in Serilog

I need to be able to temporarily disable logging for some scope. In my case there is a background task which periodically attempts to instantiate some device API for every available COM port in...

Spring Boot YML configuration for Log output in JSON

I am trying to get log output in JSON format. I achieved it by configuring logback.xml file. Is it possible to achieve same by YML file ? <appender name="STDOUT"...

Excel - We found extra characters at the end of JSON input

I am trying to import my json file to excel via the get data function. When doing this i get an error saying that "We found extra characters at the end of JSON input" i ran the json file in...

LOGBACK : How to log entire msg using JSONLayout

We are changing our logs from Text to JSON. I used below code to implement JSON logs : LayoutWrappingEncoder layoutEncoder = new LayoutWrappingEncoder(); ...

How to view Serilog log file while it is used by another process?

I am logging my data by Serilog and I am not able to view the log files of the current day because they are used by another process. I created logger in my program.cs and it is logging data very...

Slf4j, logback - removing mdc tag from json

I am adding come context info to log records using MDC: MDC.put("Correlation-ID", UUID.randomUUID().toString()); I am using following logback encoder: <encoder...

Getting a Simple Symfony 5 App On Amazon AWS As An API Gateway/Lambda For Amazon Cognito

This may involve way too many specific technologies for anyone to be able to answer, but I thought I'd give it a shot. I've ready SO Many tutorials and feel like I'm SO close...there's maybe just...

JSON Layout with Pattern in Logback Java

I am using logback for logging in my spring boot application and using the pattern as per: "%d [%thread] %-5p [%c] [%F:%L] [trace=%X{X-B3-TraceId:-},span=%X{X-B3-SpanId:-}] - %msg%n" Now I want...

Scala | How can this code be put into a macro annotation?

I have many wrapper classes which all they do is add type safety plus formatting. Besides the ClassName, each wrapper class is essentially the same. import com.helpers.buildFormatter import...

Use Monolog Logger to send output to Sentry

I currently have php setup to write its error messages, exceptions, ... to stderr using Monolog and I wanted to add an additional Handler to send the output directly to Sentry. This is what I have...

Serilog LogContext.PushProperty not working

I'm initializing Serilog in Program.cs, reading the configuration from appsettings.json, adding middleware in Startup.cs -> Configure and Use Request Middleware. Some snippets: Starup Extension ...

Can I access the request object in a console error?

I am not very familiar with Django but have to make some changes to how it logs for a project. I am wanting to add information from the request object to the logs. import logging MODULE_LOGGER =...

How to configure Serilog Elasticsearch error hanling in appsettings in .NET Core 3.1?

I am trying to configure Serilog in .NET Core 3.1 (C#) project, but I want to do that completely in appsettings.json. For file sinks I did all configuration w/o any problem, but for elasticsearch...

Logging exception stacktrace with custom rollingFileAppender and custom JsonLayout

I have written a custom logger with its own rolling file appender. I am logging an exception using one of the log messages (e.g., info(), debug(), etc.), I am excepting that it would print the...

Log without Exception stack trace in Serilog

I am using Serilog and Serilog.Exceptions for structured logging purposes in my MVC5 application. I want to remove the stack trace from the value of the "Exception" field in the log. I understand...