src/main/java/br/org/soujava/twitter/controller/TwitterConnect.java
public void logMessages(SortedSet<Twitter> msgs) {

        LinkedHashSet<MessageGrupedVO> messages = new LinkedHashSet<>();
        msgs.forEach(tweet -> {
            MessageGrupedVO m = new MessageGrupedVO(
                    tweet.getId(),
                    tweet.getCreated(),
                    tweet.getText(),
                    tweet.getTwitterUser().getId(),
                    tweet.getTwitterUser().getCreated(),
                    tweet.getTwitterUser().getName(),
                    tweet.getTwitterUser().getScreenName());
            messages.add(m);
        });

        ObjectMapper mapper = new ObjectMapper();

        try {
            logger.info(mapper.writeValueAsString(messages));
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
    }
/**
     * logMessages will log twitts to info; logback will pipe it to twitter.log file
     *
     * @param msgs
     */
logMessages will log twitts to info; logback will pipe it to twitter.log file
@param msgs
logMessages will log twitts to info ; logback will pipe it to twitter . log file @param msgs
public void logMessages(SortedSet<Twitter> msgs) {
        LinkedHashSet<MessageGrupedVO> messages = new LinkedHashSet<>();
        msgs.forEach(tweet -> {
            MessageGrupedVO m = new MessageGrupedVO(
                    tweet.getId(),
                    tweet.getCreated(),
                    tweet.getText(),
                    tweet.getTwitterUser().getId(),
                    tweet.getTwitterUser().getCreated(),
                    tweet.getTwitterUser().getName(),
                    tweet.getTwitterUser().getScreenName());
            messages.add(m);
        });
        ObjectMapper mapper = new ObjectMapper();
        try {
            logger.info(mapper.writeValueAsString(messages));
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
    }
public void logMessages ( SortedSet < Twitter > msgs ) { LinkedHashSet < MessageGrupedVO > messages = new LinkedHashSet < > ( ) ; msgs . forEach ( tweet -> { MessageGrupedVO m = new MessageGrupedVO ( tweet . getId ( ) , tweet . getCreated ( ) , tweet . getText ( ) , tweet . getTwitterUser ( ) . getId ( ) , tweet . getTwitterUser ( ) . getCreated ( ) , tweet . getTwitterUser ( ) . getName ( ) , tweet . getTwitterUser ( ) . getScreenName ( ) ) ; messages . add ( m ) ; } ) ; ObjectMapper mapper = new ObjectMapper ( ) ; try { logger . info ( mapper . writeValueAsString ( messages ) ) ; } catch ( JsonProcessingException e ) { e . printStackTrace ( ) ; } }
logMessages will log twitts to info; logback will pipe it to twitter.log file
 @param msgs
logMessages will log twitts to info ; logback will pipe it to twitter . log file @param msgs