My web application has many timed looped ajax requests that get content from different controllers and it is increasing my daily log sizes to 2 GB. Is there a way to disable logging only for specific controllers when called? Logging should be disabled upon the first instance of the controller and then re-enabled right before calling the load->view method.
As you likely know the error logging thresholds are
0 = Disables logging (TURNED OFF)
1 = Error Messages (including PHP errors)
2 = Debug Messages
3 = Informational Messages
4 = All Messages
You should be able to use the following to turn logging off.
$this->config->set_item('log_threshold', 0);
This could be done in specific controller methods or in the controller constructor if you want all its methods to stop logging.
To resume logging, i.e. at the "All Messages" level run this
$this->config->set_item('log_threshold', 4);
Understand that any calls to config->set_item() are NOT persistent. The call does not change the contents of config.php so the next time the site receives a request it will use the log threshold as defined in the config file.
Likewise, if after the level is changed dynamically the config file is reloaded it will overwrite the dynamically assigned value. AFAIK, CodeIgniter only loads the config file(s) once per framework instance. But developers do weird stuff sometimes.
Related
I have saved the HTTP Header Manager information for an endpoint as below:
However, when i execute this test plan i see in the test results tree view, many of the hits fail. I figure from the response headers i see there that it is using the header value i had put in earlier.
Why are these history values being used? How do i get rid of it.
Check the request start time, it might be the case you're looking at "old" results and you need to scroll down to see "new" results. Alternatively you can invoke Clear all menu entry which will remove all the previous results, logs, etc.
Running tests in GUI mode should only be used for development and debugging, for your 100 threads you should switch to command-line non-GUI mode
Also when you're done with designing your test consider removing all the listeners as they don't add any value and just consume valuable resources. More information: Reducing resource requirements
I assume you have a Header Manager for the specific http request (HTTP Sampler). You need to override the values in the individual HTTP Sampler's Header Manager. JMeter follows hierarchy where you can override values at node level.
I am currently looking at the options to add real-time tracking of all the messages going over in my application.
I have enabled messagehistory so technically I'll get all the steps happened during the flow.
Now I want to store each message with the history in disk cache using CQEngine as it has great support and is very quick.
Then from the UI I'll show the message and history and display using GraphVIZ so the users can actually see the lifecycle of each message with diagram.
Option # 01
Add the call in the handle() method in each flow to add the message and history asynchrnously in the disk cache.
But this means I'll have to manually do that every time for new flow.
Is there any option 02 I can utilize like adding interceptor etc that
will be called whenever a flow is completed succesfully or
un-sucessfully?
You need to use a WireTap interceptor for channels: https://docs.spring.io/spring-integration/docs/5.2.2.RELEASE/reference/html/core.html#channel-interceptors.
And configure a global channel interceptor pattern for that wire-tap to specify those channels you would like to track. The same doc has info on the matter. Also see annotation configuration on the matter: https://docs.spring.io/spring-integration/docs/5.2.2.RELEASE/reference/html/configuration.html#annotations
I am trying to work out a way to provide a CSV download through a Spring 3 Portlet. I have a method that uses the #ResourceMapping annotation to define a handler that takes some report params in the form of a #ModelAttribute, builds the report, and returns it. The catch-22 I am running into is validating the parameters being send in from the client form.
If I make the handler a #ResourceMapping, I can set the headers and write out the report as using the ResourceResponse, but I can't seem to figure out how to redirect the user back to the Portlet view with errors when their input fails validation. However, if I make it an #ActionMapping, I can then check the BindingResults and forward them back to the form as needed, but the ActionResponse doesn't allow me to set the Content-Disposition header nor write out the CSV bytes, which is sort of critical for sending the report back.
I am at a total loss here, as I don't even know what my options are. Is it even possible to do what I am trying to do with a Portlet? Are there other examples I could look at for a possible work-around?
I suggest you to use both #ActionMapping and #ResourceMapping to fulfill your requirement.
As you said you were able to handle the validation errors using the #ActionResponse, I'll tell you how to handle the Resource Streaming.
As you know every #ActionResponse is followed by a #RenderResponse, just return the same view but, with a hidden iframe this time whose src points to the ResourceURL.
Now the Request you receive in #ResourceMapping is something which is already Validated. So, you can now serve your CSV.
I dont know how complex is your UI and if you are using jsp as views in your application. If nicely managed, Validation can be handled by #ResourceMapping.
Thank you
I would like to log communications activity and, as part of logging, display communications history in a window on the screen. I don't want the communications modules to know about the screen of course, but any method can write to the log. The logging module then routes the information as appropriate (screen, file). Is logging considered part of the model?
Whether the commands, that are executed by instance, are logged or not should not affect the instance itself. Which means that if, for example, you want to log operation performed by controller, the controller itself should not be doing the logging or in any other way be aware that it gets logged.
The much better option is to have the instance decorated. The decorator would require the original instance and a logger injected thought constructor.
Assuming that your MVC components (views, controller and structures from mode layer) are already created via factory, this would be the best "level" at which you switch between logged and unlogged mode.
TL;DR
No. Logging is not part of MVC triad itself.
In our JSF2 project on JBoss 7.1.1, we define a session timeout in the web.xml and it works just fine.
However, sometimes we're getting view expiration, leading to errors like this one even if the session is still alive:
javax.faces.application.ViewExpiredException: viewId:/... - View /... could
not be restored.
Where can we set the view timeout, like we did for sessions? Or is the view expiration caused by something else?
Another cause of ViewExpiredException is that too many logical views are been created in the session. The default limit is JSF implementation specific and every synchronous GET request on a particular view basically creates a new view. So, for example, when you use Mojarra (which has a default limit of 15) and start a browser session and open the same view in 16 different tabs and then submit a form in the 1st one, then you may get this exception as well. The limit is configureable with a JSF implementation specific context parameter, which is com.sun.faces.numberOfLogicalViews for Mojarra and org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION in MyFaces (defaults to 20).
This is however a very rare real world problem. If your webapp is really designed to be used this way (e.g. a social/community site which invites to being opened in multiple tabs, such as discussion forum or Q&A), then you might consider using client side state saving instead.
See also:
javax.faces.application.ViewExpiredException: View could not be restored
com.sun.faces.numberOfViewsInSession vs com.sun.faces.numberOfLogicalViews