We are acutally using Spring Boot 1.5.8 and as I can see, we haven't specified a specific logging framework. I'm responsible for JUnit tests as junior developer. We have about 17'000 Unit tests. When I run a lot of tests, IntelliJ can't or has performance issues with handling the console output. And I gave IntelliJ a lot of power ...
Now I adjusted the Log.LEVEL in application.yml to WARN, which works fine. But then I tried to get rid of the HTTP response & request output in the console. But even when I turn off the logging with
logging:
level:
root: WARN
in application.yml it still shows HTTP requests & responses like this:
this is filling up the console depending on the request with hundreds or thousand lines of in some cases unnecessary code!
I'm looking for an option to turn this off ... please help me. I was searching for a while, but couldn't find a answer. Probably I'm on a completely wrong road with looking after Spring Boot Logging. Thank you =)
Edit:
As an other example:
I get an error an the following console output. I just need the first lines of the start and the red (+ some additional) lines. As you can see on the scrollbar, this is just a small piece of the complete output! Acutally 7033 lines (!) are filled with HTTP request & responses like the one in the first picture.
Eek! You used:
logging:
level:
root: WARN
which is yaml format! (it would work just fine if you renamed your file application.yml)
I believe you need to express it like this:
logging.level.root=WARN
which is the correct way to express it in an application.properties file.
By chance I found the solution. I had to set print = MockMvcPrint.NONE in the #AutoConfigureMockMvc annotation. It seems like this collected the HTTP request & respones for each failed test and print everything whenever a test fails! This led to an tremendous output after some failures!
Related
This is in regards to the sample: msal-web-sample-0.1.0
I am using tomcat 9 and maven to build and run the msal-web-sample code. It is building fine and running, loading spring, etc. I am able to go out and get a username and passowrd login. However, when it tries to return back to my system (https://localhost:8443/msal4jsample/secure/aad) it just has a bit "ERROR PAGE!" heading with Home Page link going back to the main tomcat page.
In the tomcat runtime it has:
2021-06-29 15:28:06.108 ERROR 6360 --- [io-8443-exec-10] o.s.b.w.servlet.support.ErrorPageFilter : Cannot forward to error page for request [/secure/aad] as the response has already been committed. As a result, the response may have the wrong status code. If your application is running on WebSphere Application Server you may be able to resolve this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService to false
Of course, that doesn't apply to my setup.
I see the get in the logs returning back OK and don't see any errors on startup. I am at a loss as to where to go from here. Any thoughts?
Also, is there a non-spring implementation that can be used with java but still using MSAL?
Thanks
Alan
Please share additional information about the error. Do you have trouble regrading AAD? Check your environmental settings (Tomcat) if this isn't the case.
We have an application that uses asyncresponse and writes the data into a stream.
I upgraded to spring2 from 1.5.
And not sure if it could be releated but now with postman I get this error "Unexpected end of file".
Even in a java client , I get error "java.IO.EOFException: Unexpected end of zlib input stream".
But I get expected result in a curl command.
Now I suspect, this could be something either with user-agent or somewhere in spring2 or jersey , I need to set some properties to get rid of this.
There is no security , I excluded SecurityAutoConfiguration.java, in case somewhere it checks some user-agent.
Because of error I see in java client, I tried with server.compression.enabled=false (which is default anyway), but no luck.
I suppose I need to edit the question.
It seems there is some issue using StreamingOutput using spring2x. This is not streaming which I assumes results in all of above stated issues.
Any help is appreciated.
I want to disable debug logs and want other logs to put in a file(logfile). I have tried following two snippets. But it doesnt work as expected.
log.all.filter.module.app = logfile
log.all.filter.module.revel = logfile
log.debug.filter.module.app = off
log.debug.filter.module.revel = off
log.all.output = logfile
log.debug.output = off
Going through the revel log documentation (http://revel.github.io/manual/logging.html), they have mentioned that order of the log is significant but it isnt working in this case it seems. Am i missing something?
I think what you are seeing is debug output from the proxy. When running the revel application from the command line like
revel run myapp
The proxy starts up in debug mode (meaning you will see lots of debug messages), after the application has started the log should be configured to what is set in the app.conf
Also there may be an assumption that off is an active handler, so it would discard the data, unfortunately the handlers are "or"ed logically together, not "and"ed so setting all outputs to one handler then turning one off does not affect the logger set to all
We are using Sentry for finding some errors.
How do you proof, that a reporting is working?
I had a Spring-Boot project, which was not sending any error to Sentry, so it looks like it was working without an error, but I saw in Kibana, that there have been errors.
So, my configuration was wrong. After fixing the setup, it's now sending the errors to Sentry too.
Is there any way to proof that the sending to Sentry is working?
Something like on startup of my Spring-Boot application sending a first string?
I found 2 possible solutions which both sucks, so that's why I ask for a more professional way:
I can make just on application start up a log.error("sentry is working")
I can set the log-level from warning / error to info just to see that it's working and if see it in Sentry, you change it back?
But as i mentioned, both methods are not good, so let me know how you are resolving problems like this
are unprofessional to me, so let me know
There isn't a real "answer" here currently, as part of Sentry's simplicity is it doesn't do anything until an error happens. One potential solution is to introduce a path like example.com/500 that deliberately errors.
I installed dredd - API Blueprint Testing Tool and trying to test our APIary API against the implementation.
In the blueprint I have just one resource which is correctly implemented on somehost... but test fails :(
test command:
dredd apiary.apib http://somehost.de:8443/imp-endpoint
output:
Info: Beginning Dredd testing...
undefined
I tried also with more options to get more information what is undefined.. like -l verbose and some other options. But I did not get more information about the failure :(
Does anyone have experience with it? Thank you!!! :)
Answered on Github but I'll reproduce the main points here for reference:
I wasn't able to to reproduce your "undefined" problem, but there are a few issues that, when corrected, make everything work.
At the moment, the base url can't have a path in it (see #43). This is solved in #45 but hasn't yet been merged. So your command should be 'dredd apiary.apib http://somehost.de:8443/' and then '/imp-endpoint' should be a prefix on the urls.
The URI template is incorrect in your apib file. Instead of /api/V0/Resources/CarSharing/Cars?{lat}&{lng}&{radius}, it should be /imp-endpoint/api/V0/Resources/CarSharing/Cars{?lat,lng,radius}. See RFC6750 for reference.
The line-endings should be Unix style, not Windows (\n, not \n\r). When I first ran the apib you provided, I got the error: the use of carriage return(s) '\r' in source data isn't currently supported, please contact makers (this is actually enforced by the blueprint parser, see snowcrash)
Hope that helps! I get a 401 when running the test, so you'll need to provide HTTP Basic authentication information (this can be done in the header section of the blueprint or with the -u flag on dredd, as in -u username:password)