react-logshine

1.0.0 • Public • Published

react-logshine


Shine light on your log files (Papertrail only).

NPM version node version npm download

Screenshot

react-logshine

Install

react-logshine

Usage

var React = require('react');
var ReactDOM = require('react-dom');
var LogShine = require('react-logshine');
require('react-logshine/lib/LogShine.css');
ReactDOM.render(<LogShine token="your_token"/>, container);

Props

Property Type Description Default value
height PropTypes.string Component height 500px
width PropTypes.string Component width 100%
token PropTypes.string.isRequired Papertrail token null
query PropTypes.string LogShine query null
systemID PropTypes.number or PropTypes.string System to search by ID or in most cases, by name null
groupID PropTypes.number Group to search null
follow PropTypes.bool Follow (tail -f) true
delay PropTypes.number Delay between refresh in seconds 10
showTopToolbar PropTypes.bool Show top toolbar true
showBottomToolbar PropTypes.bool Show bottom toolbar true
backgroundColor PropTypes.string Set background color #252830
dateTimeColor PropTypes.string Set datetime color #e4d836
systemColor PropTypes.string Set system color #1bc98e
programColor PropTypes.string Set program color #9f86ff
messageColor PropTypes.string Set message color #ffffff
topToolbarBackgroundColor PropTypes.string Set top toolbar background color #258ddf
rowFormat PropTypes.function Custom row format null

Custom row format

let rowFormat = function(event) {
  return(
        <li className="LogShine event" key={event.id}>
         <hr style={{width: '90%'}}/>
         <p>Date: {event.generated_at}</p>
         <p>System: {event.host}</p>
         <p>Program: {event.program}</p>
         <p>{event.message}</p>
       </li>
  );
}
 
ReactDOM.render(
  <LogShine token="your_token" rowFormat={rowFormat}/>, document.getElementById('root')
);

Development

npm install
npm start

Example

http://localhost:3000

History

View the changelog

Authors

License

Copyright (c) 2016 Quentin Rousseau <contact@quent.in>
 
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
 
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

Package Sidebar

Install

npm i react-logshine

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • kwent