Is there any way to write plugin logs to a file or send them remotely?

Is there any way to write plugin logs to a file or send them remotely?