GithubHelp home page GithubHelp logo

acrofrank / aliyun-log-producer-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aliyun/aliyun-log-producer-sample

0.0 1.0 0.0 43 KB

Aliyun LOG Java Producer Sample Application

License: Apache License 2.0

Java 100.00%

aliyun-log-producer-sample's Introduction

Aliyun LOG Java Producer Sample Application

License

中文版 README

This repo provides the sample application for Aliyun LOG Java Producer, it will help you to master the producer library more quickly.

Prerequisite

You will need the following:

  • Opening Aliyun Log Service and create target project, logstore in advancce.
  • Prepare the AK used by producer.
  • Install JDK 1.6+.
  • Install Maven (brew install mavensudo apt-get install maven).

If you use the sub-account AK, you need to configure the following permissions for the account to ensure it can put logs to the target logstore.

Action Resource
log:PostLogStoreLogs acs:log:${regionName}:${projectOwnerAliUid}:project/${projectName}/logstore/${logstoreName}

Set environment variables

The sample will read the value of project, endpoint, logstore and AK from environment variables. You can set the value of them in .producerrc and then run the command source .producerrc.

Run the Sample

After the above tasks have been finished, do a clean build to compile the source code and generate jar:

mvn clean package

Then run the producer with callback to send some logs to your logstore:

mvn exec:java -Dexec.mainClass="com.aliyun.openservices.aliyun.log.producer.sample.SampleProducerWithCallback"

Run the producer with future to send some logs to your logstore:

mvn exec:java -Dexec.mainClass="com.aliyun.openservices.aliyun.log.producer.sample.SampleProducerWithFuture"

aliyun-log-producer-sample's People

Contributors

brucewu-fly avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.