Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send log statements over the network through CocoaLumberjack?

In the summary of CocoaLumberjack it is mentioned that "Lumberjack is Powerful", and then "Want more? Create your own loggers (it's easy) and send your log statements over the network." So, I wonder how can we send log statements over the network through CocoaLumberjack? Is there an existing interface to do this? Or must we do it by our own code? Could somebody give me sample code to this?

like image 352
user3910365 Avatar asked Aug 13 '14 09:08

user3910365


1 Answers

To answer your question, there isn't anything built-in for sending logs over the network.

You can take the highroad and:

  • obtain the logs by creating a new logger (see how this guy created a new logger that redirects the logs to Crashlytics: https://github.com/TechSmith/CrashlyticsLumberjack)

OR

  • read the logs from a file logger and sending those over the network. Use the DDFileLogger logFileManager to get the sortedLogFilePaths (list of paths to the log files). Those files are plain text and can be read like any other file.
like image 65
Bogdan Avatar answered Dec 24 '22 04:12

Bogdan