Closed vikram-rawat closed 3 years ago
Please consider asking question on stack-overflow as suggested in CONTRIBUTING
Why would you need to pass file argument at each invocation of the printer? It looks you are trying to solve some non-existent problem (or at least very weird). You can use ?sink
to redirect output to the file.
Generally it makes sense to use lgr package for user-level logging. Built-in logger has the same interface as lgr
.
To me logging is writing down which request has been processed at what URL with what result status. Like
Post URL 200 date
Something I am familiar with other languages.
Now I am really curious what does the logger do...
Because after the server starts I don't see any log printed even on the screen and the documentation is not clear on that part. It only talk about how to do it manually while testing.
Is there a way i can get that output in a file???
To me logging is writing down which request has been processed at what URL with what result status. Like Post URL 200 date
Have you tried application$logger$set_log_level("debug")
?
Is there a way i can get that output in a file???
You can either:
Rscript app.R > log.txt
set_printer
methodlgr
pkg which allows to specify sinks in a very flexible way application$logger = lgr::get_logger("logger_name")
. See vignette.This command actually helped a lot. thanks for replying.
application$logger$set_log_level("debug")
Sorry to bug you for such a simple query. I thought There should be a way to pass file argument in the function. but this will work too..
I could have asked the question on StackOverflow. but it doesn't allow me to ask questions. Is it possible to ask questions on community.rstudio.com?
those questions will actually help people googling with the same problem later on.
Thanks again.. :-)
This function is more than enough for every need but how would pass file argument to the cat function.
Is there a way to pass this argument ??