[yast-devel] RFC logs API, settings
Right now there is a resource /logs which support only index (in all formats) and show (only in txt format) <logs type="array"> <log> <id>system</id> <path>/var/log/messages</path> <description>System messages</description> </log> <log> <id>apache</id> <path>/var/log/apache2/access_log</path> <description>Apache</description> </log> </logs> The other supported API is /logs/id?lines=x which only answers in .txt format. I experimented with two ways to define those logs, you can't pass an arbitrary filename to the API because that would be a security hole, but you can define them in vendor config files. Here are the two approaches. 1) in /etc/YaST2/vendor.yml together with other vendor settings: bug_url: http://www.bugs.com packages: - mydb-server - mydb-console log_files: - /var/log/messages - /var/log/apache2/access_log And then you get them as /logs/0, logs/1 However, this has the drawback that you dont know anything else from the log to display it in the user interface. Then a second approach, cat /etc/YaST2/vendor/logs.yml system: path: /var/log/messages description: System messages apache: description: Apache path: /var/log/apache2/access_log Then the client can display more information about them. Which approach seems better? simplicity vs usefulness? -- Duncan Mac-Vicar P. - Engineering Manager, YaST SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (1)
-
Duncan Mac-Vicar Prett