8000 add console, file, and zulip logger on database changes by huneau · Pull Request #1010 · wekan/wekan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add console, file, and zulip logger on database changes #1010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2017
Merged

add console, file, and zulip logger on database changes #1010

merged 2 commits into from
Apr 27, 2017

Conversation

huneau
Copy link
Contributor
@huneau huneau commented Apr 19, 2017

hi there,

Related here: #1001

I create a logging mechanism using winstonjs.

The supported log is console, file, and zulip, up to you if you want more.

Actually, only JSON is supported as output.

Possible output

{"userId":"7gLzSQYeLadyScLb4","type":"card","method":"update","doc":{"_id":"DvwygsfayN2KTSFjt","title":"regezrg","members":[],"labelIds":[],"listId":"kFApw5GrTRSwc86BZ","boardId":"ZeEpvQXNfKG2BDoFD","sort":6,"archived":false,"createdAt":"2017-04-14T13:09:56.617Z","dateLastActivity":"2017-04-19T13:51:30.937Z","userId":"7gLzSQYeLadyScLb4"},"fieldNames":["listId","sort","dateLastActivity"],"modifier":{"$set":{"listId":"th5sg8cYSBzB4Qm3J","sort":6,"dateLastActivity":"2017-04-19T13:57:18.579Z"}},"timestamp":"2017-04-19T13:57:18.581Z","message":"","level":"info"}

This one is when a card is moved.

Only database changes are logged.


This change is Reviewable

@CLAassistant
Copy link
CLAassistant commented Apr 19, 2017

CLA assistant check
All committers have signed the CLA.

@huneau
Copy link
Contributor Author
huneau commented Apr 20, 2017

I have signed the license, why it won't validate it.

@xet7
Copy link
Member
xet7 commented Apr 25, 2017

@huneau

Please provide commands you used:

  • installing all dependencies like node.js etc
  • starting wekan.

I did not get it working yet, so probably I used wrong versions etc.

@huneau
Copy link
Contributor Author
huneau commented Apr 27, 2017

Hi,

I do nothing important,

  • dependencies

    • npm install winston
    • mpn install winston-zulip
  • meteor to run without any other options

The build is ok, so the dependencies should be here oO.

@xet7
Copy link
Member
xet7 commented Apr 27, 2017

@huneau

I need all steps of cloning repo, installing node.js version, and versions of other dependencies to reproduce working version of wekan. In addition, how do I test your feature and see how it works? What menu options are new, does it integrate with something, commands to use to test it, etc.

@huneau
Copy link
Contributor Author
huneau commented Apr 27, 2017

I need all steps of cloning repo, installing node.js version, and versions of other dependencies to reproduce working version of wekan.

git clone https://github.com/huneau/wekan.git
cd wekan/
git checkout meteor-1.4-LOGGER

### for the rest nothing change 

sudo npm -g install npm@latest
sudo npm -g install node-gyp
sudo npm -g install fibers

npm install

meteor

I have added a few environment variable :

export LOGGER_ENABLE=< true || false >

## LOGGERS => list of logger type, concatenate with a comma 
## actually supported 'console', 'file','zulip' (zulip is my use case)
export LOGGERS=console,file

## For Console nothing any settings needed

## For File 
## File will be create logs/<filename>
export LOGGER_FILE_NAME=<file name>

## For Zulip
export LOGGER_ZULIP_USERNAME=<zulip username>
export LOGGER_ZULIP_APIKEY=<zulip apikey>
export LOGGER_ZULIP_REALM=<zulip host>
export LOGGER_ZULIP_TO=<stream>
export LOGGER_ZULIP_SUBJECT=<stream topic>

I think that's it.

how do I test your feature and see how it works?

For console

export LOGGER_ENABLE=true
export LOGGERS=console

For file

export LOGGER_ENABLE=true
export LOGGERS=file
export LOGGER_FILE_NAME=server.log #create if not exist

For both

export LOGGER_ENABLE=true
export LOGGERS=console,file
export LOGGER_FILE_NAME=server.log #create if not exist

For zulip is a bit more complex
Project : https://github.com/galexrt/docker-zulip

##WEKAN CONF
export LOGGER_ENABLE=true
export LOGGERS=zulip
export LOGGER_ZULIP_USERNAME=<zulip username>
export LOGGER_ZULIP_APIKEY=<zulip apikey>
export LOGGER_ZULIP_REALM=<zulip host>
export LOGGER_ZULIP_TO=<stream>
export LOGGER_ZULIP_SUBJECT=<stream topic>

#####################################

## ZULIP INSTALLATION
git clone https://github.com/galexrt/docker-zulip.git
cd docker-zulip/
## replace SETTINGS_* variables
vi docker-compose.yml
docker-compose up -d
##after is a zulip webapp config for bot and apikey etc etc

What menu options are new?

Any menu has been changed.

does it integrate with something?

I use Zulip here, but if you don't call it in environment variable you need nothing else.

commands to use to test it ?

Nothing, just plays with wekan and you will see logs appear where you have specified them.

If you need more, just ask and I will try to respond quickly as possible.
Thinks.

@xet7
Copy link
Member
xet7 commented Apr 27, 2017

@huneau

What node version are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0