Repository navigation
Logfile download - #12988
Logfile download#12988
Conversation
1e04c51 to
fe39822
Compare
|
please review @MorrisJobke @LukasReschke |
|
@DeepDiver1975 @PVince81 what do you the think? |
There was a problem hiding this comment.
This won't work if the logger isn't of the class OC_Log_Owncloud. Is this the intended way to work? I will test this with other log implementations and how it behaves nowadays
There was a problem hiding this comment.
This will not work in case the log file is redirected to syslog - has to be handled as well.
There was a problem hiding this comment.
the whole log viewer in the admin settings only works with OC_Log_OwnCloud. (see the lines above the one I added). Do we want to change this behaviour?
There was a problem hiding this comment.
This will not work in case the log file is redirected to syslog
How are logs from syslog handled right now in the admin settings?
There was a problem hiding this comment.
They simply don't work. You get an empty response from OC_Log_Owncloud (as there is nothing written there) Maybe add a check and hide the section if something different is setup for ownCloud
|
and squash please - thx |
There was a problem hiding this comment.
The type is already enforced by the type annotation :-)
@param int $level will enforce that the type is an int or set the value to 0.
Btw. VERY cool that you use the AppFramework. Kudos for that!
|
👍 |
|
@georgehrke can we get some momentum on this? THX |
I will squash, add the test for the private method and add some kind of readfile response asap. About the syslog problem: |
|
Thanks Georg. Regarding syslog: we shall not allow download in this case - as a result we shall not offer this in the ui. |
|
thanks @georgehrke i agree with @DeepDiver1975 downloading syslog makes no sense |
|
@georgehrke can you look into that? |
|
@karlitschek Yes, will push my changes tomorrow |
|
cool. You like last minute changes, right? ;-) |
aeac6fb to
67cb086
Compare
concerning the Response template: So I'd vote to stay with readfile inside the LogSettingsController for now. |
|
👍 fine from my side |
|
Jenkins PR is in #13075 |
There was a problem hiding this comment.
You can inject OCP\ITimeFactory and call $factory->getTime() to be able to test it instead of using time() directly
There was a problem hiding this comment.
needed? Please kill this - we shall use http status codes if necessary
There was a problem hiding this comment.
it's checked for in the js, but we can remove that check
There was a problem hiding this comment.
THe JS part can also rely on the HTTP code (even jQuery support two different callbacks for success and failure ;))
There was a problem hiding this comment.
Also here pretty sure that this is not required at all
There was a problem hiding this comment.
Lol - @DeepDiver1975 was faster while I was reviewing ;-)
add logSettingsController add download logfile button move getEntries to LogSettingsController move set log level to logsettingscontroller.php add warning if logfile is bigger than 100MB add unit test for set log level fix typecasting, add new line at EoF show log and logfile download only if log_type is set to owncloud add unit test for getFilenameForDownload
be2c2c8 to
f579f2b
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
The inspection completed: 10 new issues, 17 updated code elements |
|
👍 still works |
|
👍 |
First stab at the StreamResponse, see #12988 The idea is to use an interface ICallbackResponse (I'm not 100% happy with the name yet, suggestions?) that allow the response to output things in its own way, for instance stream the file using readfile Unittests are atm lacking, plan is to check if a mock of ICallbackResponse will be used by calling its callback (also unhappy with this name) method Usage is: $response = new StreamResponse('path/to/file');
First stab at the StreamResponse, see #12988 The idea is to use an interface ICallbackResponse (I'm not 100% happy with the name yet, suggestions?) that allow the response to output things in its own way, for instance stream the file using readfile Unittests are atm lacking, plan is to check if a mock of ICallbackResponse will be used by calling its callback (also unhappy with this name) method Usage is: $response = new StreamResponse('path/to/file'); rename io to output, add additional methods and handle error and not modified cases when using StreamResponse fix indention and uppercasing, also handle forbidden cases fix indention fix indention no forbidden, figuring out if a file is really readable is too complicated to get to work across OSes and streams remove useless import remove useless import fix intendation
implements / fixes #12731
TODO: