本文整理汇总了Java中com.liferay.portal.kernel.log.Log类的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Log类属于com.liferay.portal.kernel.log包,在下文中一共展示了Log类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeConfig
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
private void writeConfig(List<ConfigurationType> config) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().addLog(LOG_CONFIG);
try {
ConfigurationType cfgObj = null;
String value = null;
for (E_ConfigKey ckey : E_ConfigKey.values()) {
value = AHConfigLocalServiceUtil.getConfig(ckey.name(), ckey.getDefaultValue());
cfgObj = new ConfigurationType();
cfgObj.setKey(ckey.name());
cfgObj.setValue(value);
config.add(cfgObj);
log.log(ckey.name());
}
} catch (Throwable t) {
log.err(t.getMessage());
m_objLog.error("Error on category entries export",t);
}
}
示例2: writeCategoryChildEntries
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
private void writeCategoryChildEntries(List<CategoryEntryType> childs, long itemId) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().getLog(LOG_CATEGORIES);
try {
List<AHCatEntries> list = AHCatEntriesLocalServiceUtil.getChildEntriesById(itemId);
AHCatEntries data = null;
CategoryEntryType type = null;
for (int i=0; i<list.size();i++) {
data = list.get(i);
type = new CategoryEntryType();
type.setCatId(data.getCatId());
type.setItemId(data.getItemId());
type.setName(data.getName());
type.setDescr(data.getDescr());
childs.add(type);
if (!m_objExportedEntries.contains(data.getItemId())) {
log.log(data.getName());
m_objExportedEntries.add(data.getItemId());
}
}
} catch (Throwable t) {
log.err(t.getMessage());
m_objLog.error("Error on category entries export",t);
}
}
示例3: getLog
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public Map<String, String> getLog() {
Map<String, String> result = new HashMap<String, String>();
PersistentLog pl = PersistentLog.getInstance();
de.particity.util.PersistentLog.Log log = pl.getLog(LOG_CATEGORIES);
if (log != null)
result.put(LOG_CATEGORIES,log.toString());
log = pl.getLog(LOG_CONFIG);
if (log != null)
result.put(LOG_CONFIG,log.toString());
log = pl.getLog(LOG_OFFERS);
if (log != null)
result.put(LOG_OFFERS,log.toString());
log = pl.getLog(LOG_ORGANISATIONS);
if (log != null)
result.put(LOG_ORGANISATIONS,log.toString());
log = pl.getLog(LOG_SUBSCRIPTIONS);
if (log != null)
result.put(LOG_SUBSCRIPTIONS,log.toString());
return result;
}
示例4: initSubscriptions
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initSubscriptions(List<SubscriptionType> subscriptions) {
if (subscriptions != null && subscriptions.size() > 0) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().addLog(LOG_SUBSCRIPTIONS);
for (SubscriptionType sub: subscriptions) {
long[] catEntries = null;
if (sub.getCategories() != null && sub.getCategories().size() > 0) {
catEntries = new long[sub.getCategories().size()];
for (int i=0; i<sub.getCategories().size(); i++) {
catEntries[i] = m_objCatEntryIdMap.get(sub.getCategories().get(i));
}
}
AHSubscription subscr = CustomPersistanceServiceHandler.addSubscription(sub.getEmail(), catEntries, sub.getUuid(), E_SubscriptionStatus.valueOf(sub.getStatus()));
if (subscr != null) {
log.log(subscr.getEmail());
} else {
log.err(sub.getEmail());
}
}
}
}
示例5: initLog
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initLog(final org.apache.maven.plugin.logging.Log log) {
LogFactoryUtil.setLogFactory(new LogFactory() {
public Log getLog(String name) {
return new MavenLiferayLog(name, log);
}
public Log getLog(Class<?> c) {
return new MavenLiferayLog(c.getSimpleName(), log);
}
public void setLevel(String arg0, String arg1, boolean arg2) {
// TODO Auto-generated method stub
}
});
}
示例6: writeCategories
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
private void writeCategories(List<CategoryType> categories) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().addLog(LOG_CATEGORIES);
try {
int size = AHCategoriesLocalServiceUtil.getAHCategoriesesCount();
List<AHCategories> cats = null;
AHCategories cat = null;
CategoryType catType = null;
for (int i = 0; i<size;i+=10) {
cats = AHCategoriesLocalServiceUtil.getAHCategorieses(i, i+10);
if (cats != null) {
for (int j=0; j<cats.size(); j++) {
cat = cats.get(j);
catType = new CategoryType();
catType.setCatId(cat.getCatId());
catType.setDescr(cat.getDescr());
catType.setName(cat.getName());
catType.setType(E_CategoryType.findByValue(cat.getType()).name());
categories.add(catType);
log.log(cat.getName());
writeCategoryEntries(catType.getEntry(), cat.getCatId());
}
}
}
} catch (Throwable t) {
log.err(t.getMessage());
m_objLog.error("Error on category export",t);
}
}
示例7: writeCategoryEntries
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
private void writeCategoryEntries(List<CategoryEntryType> entries, long catId) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().getLog(LOG_CATEGORIES);
try {
List<AHCatEntries> list = AHCatEntriesLocalServiceUtil.getCategoryEntries(catId);
AHCatEntries data = null;
CategoryEntryType type = null;
for (int i=0; i<list.size();i++) {
data = list.get(i);
type = new CategoryEntryType();
type.setCatId(data.getCatId());
type.setItemId(data.getItemId());
type.setName(data.getName());
type.setDescr(data.getDescr());
writeCategoryChildEntries(type.getChildEntry(),data.getItemId());
if (!m_objExportedEntries.contains(data.getItemId())) {
log.log(data.getName());
m_objExportedEntries.add(data.getItemId());
}
// only support child to the third level
for (CategoryEntryType child: type.getChildEntry()) {
writeCategoryChildEntries(child.getChildEntry(), child.getItemId());
}
entries.add(type);
}
} catch (Throwable t) {
log.err(t.getMessage());
m_objLog.error("Error on category entries export",t);
}
}
示例8: writeSubscriptions
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
private void writeSubscriptions(List<SubscriptionType> subscriptions) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().addLog(LOG_SUBSCRIPTIONS);
try {
int size = AHSubscriptionLocalServiceUtil.getAHSubscriptionsCount();
List<AHSubscription> list = null;
AHSubscription data = null;
SubscriptionType type = null;
for (int i = 0; i<size;i+=10) {
list = AHSubscriptionLocalServiceUtil.getAHSubscriptions(i, i+10);
if (list != null) {
for (int j=0; j<list.size(); j++) {
data= list.get(j);
type = new SubscriptionType();
type.setCreated(data.getCreated());
type.setEmail(data.getEmail());
type.setStatus(E_SubscriptionStatus.findByValue(data.getStatus()).name());
type.setUuid(data.getUuid());
List<AHCatEntries> entries = AHSubscriptionLocalServiceUtil.getCategoriesBySubscription(data.getSubId());
if (entries != null && entries.size() > 0) {
List<CategoryEntryType> cats = type.getCategories();
for (AHCatEntries entry: entries) {
CategoryEntryType cet = new CategoryEntryType();
cet.setItemId(entry.getItemId());
cats.add(cet);
}
}
subscriptions.add(type);
log.log(data.getEmail());
}
}
}
} catch (Throwable t) {
log.err(t.getMessage());
m_objLog.error("Error on offer export",t);
}
}
示例9: initCategories
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initCategories(List<CategoryType> categories) {
if (categories != null && categories.size() > 0) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().addLog(LOG_CATEGORIES);
for (CategoryType type: categories) {
AHCategories cat = CustomCategoryServiceHandler.addMainCategory(type.getName(), type.getDescr(), E_CategoryType.valueOf(type.getType()));
if (cat != null) {
log.log(cat.getName());
initCategoryEntries(type.getEntry(),cat.getCatId());
} else
log.err(type.getName());
}
}
}
示例10: initCategoryEntries
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initCategoryEntries(List<CategoryEntryType> entries, long catId) {
if (entries != null && entries.size() > 0) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().getLog(LOG_CATEGORIES);
for (CategoryEntryType entry: entries) {
if (!m_objCatEntryIdMap.containsKey(entry.getItemId())) {
AHCatEntries dbentry = CustomCategoryServiceHandler.addCategoryEntry(catId, entry.getName(), entry.getDescr(), -1);
if (dbentry != null) {
log.log(entry.getName());
m_objCatEntryIdMap.put(entry.getItemId(), dbentry.getItemId());
if (entry.getChildEntry() != null && entry.getChildEntry().size() > 0) {
for (CategoryEntryType child: entry.getChildEntry()) {
if (!m_objCatEntryIdMap.containsKey(child.getItemId())) {
AHCatEntries dbchild = CustomCategoryServiceHandler.addCategoryEntry(catId, child.getName(), child.getDescr(), dbentry.getItemId());
if (dbchild != null) {
m_objCatEntryIdMap.put(child.getItemId(), dbchild.getItemId());
log.log(child.getName());
} else
log.err(child.getName());
}
}
}
} else
log.err(entry.getName());
}
}
}
}
示例11: initConfig
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initConfig(List<ConfigurationType> config) {
if (config != null && config.size() > 0) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().addLog(LOG_CONFIG);
for (ConfigurationType cfg: config) {
String value = cfg.getValue();
if (value != null && value.trim().length() > 0) {
log.log(cfg.getKey());
CustomPortalServiceHandler.setConfig(E_ConfigKey.valueOf(cfg.getKey()), cfg.getValue());
}
}
}
}
示例12: initOrganisations
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initOrganisations(List<OrganisationType> organisations) {
if (organisations != null && organisations.size() > 0) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().addLog(LOG_ORGANISATIONS);
for (OrganisationType org: organisations) {
AHOrg dborg = CustomOrgServiceHandler.addOrganisation(m_objCompanyId, m_objUserId, m_objGroupId, org.getOwner(), org.getName(), org.getHolder(), org.getDescription(), org.getLegalStatus(), org.getAddress().getStreet(), org.getAddress().getHouse(), org.getAddress().getCity(), org.getAddress().getCountry(), org.getAddress().getZip(), org.getContact().getPhone(), org.getContact().getFax(), org.getContact().getEmail(), org.getContact().getWww(), null, org.getAddress().getCoordLat(), org.getAddress().getCoordLon());
if (dborg != null) {
log.log(org.getName());
CustomOrgServiceHandler.updateLogo(m_objCompanyId, m_objUserId, m_objGroupId, dborg.getOrgId(), org.getLogo(), org.getLogoFilename());
User lrUser = null;
try {
lrUser = UserLocalServiceUtil.getUserByEmailAddress(m_objCompanyId, org.getOwner());
} catch (Throwable t) {}
if (lrUser == null) {
lrUser = CustomPortalServiceHandler.createPortalUser(org.getName(), org.getHolder(), org.getOwner(), m_objCompanyId, m_objGroupId, Locale.GERMAN, false);
lrUser.setPassword(org.getLoginPassword());
lrUser.setAgreedToTermsOfUse(true);
lrUser.setEmailAddressVerified(true);
try {
UserLocalServiceUtil.updateUser(lrUser);
} catch (Throwable e) {
m_objLog.warn("Could not update user password for user "+org.getOwner()+" id "+lrUser.getUserId());
}
}
m_objOrgIdMap.put(org.getOrgId(), dborg.getOrgId());
} else {
log.err(org.getName());
}
}
}
}
示例13: initOffers
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initOffers(List<OfferType> offers) {
if (offers != null && offers.size() > 0) {
de.particity.util.PersistentLog.Log log = PersistentLog.getInstance().addLog(LOG_OFFERS);
for (OfferType offer: offers) {
Long orgId = offer.getOrgId();
orgId = m_objOrgIdMap.get(orgId);
long[] categories = null;
if (offer.getCategoryItem() != null && offer.getCategoryItem().size() > 0) {
categories = new long[offer.getCategoryItem().size()];
for (int i=0; i<offer.getCategoryItem().size();i++) {
CategoryEntryType entry = offer.getCategoryItem().get(i);
categories[i] = m_objCatEntryIdMap.get(entry.getItemId());
}
}
if (orgId != null) {
AHOffer dbOffer = CustomOfferServiceHandler.addOffer(-1L, offer.getTitle(), offer.getDescription(), orgId, E_OfferType.valueOf(offer.getType()), offer.getContact().getForename(), offer.getContact().getSurname(), offer.getContact().getPhone(), offer.getContact().getEmail(), offer.getSndContact().getForename(), offer.getSndContact().getSurname(), offer.getSndContact().getPhone(), offer.getSndContact().getEmail(), offer.getAddress().getStreet(), offer.getAddress().getHouse(), offer.getAddress().getCoordLat(), offer.getAddress().getCoordLon(), offer.getAddress().getCity(), offer.getAddress().getCountry(), offer.getAddress().getZip(),
offer.getWorkTime(), E_OfferWorkType.valueOf(offer.getWorkType()), categories, offer.getPublish(), offer.getExpires(), offer.isContactAgency());
if (dbOffer != null) {
log.log(dbOffer.getOfferId()+" - "+dbOffer.getTitle());
} else {
log.err(offer.getOfferId()+" - "+offer.getTitle());
}
} else {
log.err(offer.getOfferId()+" - "+offer.getTitle()+" - org unknown");
}
}
}
}
示例14: initLog
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initLog(final org.apache.maven.plugin.logging.Log log) {
LogFactoryUtil.setLogFactory(new LogFactory() {
public Log getLog(String name) {
return new MavenLiferayLog(name, log);
}
public Log getLog(Class<?> c) {
return new MavenLiferayLog(c.getSimpleName(), log);
}
});
}
示例15: initLog
import com.liferay.portal.kernel.log.Log; //导入依赖的package包/类
public void initLog(final org.apache.maven.plugin.logging.Log log) {
LogFactoryUtil.setLogFactory(new LogFactory() {
public Log getLog(String name) {
return new MavenLiferayLog(name, log);
}
public Log getLog(Class<?> c) {
return new MavenLiferayLog(c.getSimpleName(), log);
}
});
}