0

I know php but my server doesn't support it but support ruby.
But unfortunately, I have few knowledge about ruby.

I just want to save errors of my javascript application and activities of users in the javascript application.

I probably need a ruby program which processes the followings:
- get data which submitted with jQuery.post() from the page of the application.
- create a name of a log file which formatted like YYYY-MM-DD.log.
- open the log file.
- lock the log file.
- add the data to the end of the file.
- unlock the log file.
- close the log file.


2 Answers 2

1

The Logger class in Ruby's standard library should cover your needs. The date can be formatted with [Logger#datetime_format=]. Here's an example.

1

http://rubylearning.com/satishtalim/ruby_logging.html

may help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.